Re: [PATCH v2 2/2] libmount: handle arbitrary line length for mounts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Aug 26, 2015 at 4:34 PM, Karel Zak <kzak@xxxxxxxxxx> wrote:
> On Wed, Aug 26, 2015 at 03:49:23PM -0700, Kees Cook wrote:
>> @@ -212,6 +212,8 @@ struct libmnt_table {
>>       int             comms;          /* enable/disable comment parsing */
>>       char            *comm_intro;    /* First comment in file */
>>       char            *comm_tail;     /* Last comment in file */
>> +     char            *buf;           /* Memory for reading lines */
>> +     size_t          buf_size;       /* Size of line-reading buffer */
>
> It's overkill to add the buffer to the struct, it's necessary
> only in mnt_table_parse_next().

It seemed really inefficient to go from a stack buffer to a
malloc-per-call of mnt_table_parse_next(). I'm fine to write it that
way, though. What do you think is best here?

-Kees

-- 
Kees Cook
Chrome OS Security
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux