This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv7] nss_db: protect against empty mappings
- From: Florian Weimer <fweimer at redhat dot com>
- To: DJ Delorie <dj at redhat dot com>
- Cc: Andreas Schwab <schwab at suse dot de>, carlos at redhat dot com, libc-alpha at sourceware dot org
- Date: Fri, 28 Jun 2019 15:38:38 +0200
- Subject: Re: [PATCHv7] nss_db: protect against empty mappings
- References: <xnd0j1uzf2.fsf@greed.delorie.com> <87y31ptkhx.fsf@oldenburg2.str.redhat.com>
* Florian Weimer:
> * DJ Delorie:
>
>> + rest = "/makedb -o /var/db/passwd.db /var/db/passwd.in";
>> + cmd = (char *) xmalloc (strlen (support_bindir_prefix)
>> + + strlen (rest) + 1);
>> + strcpy (cmd, support_bindir_prefix);
>> + strcat (cmd, rest);
>> +
>> + system (cmd);
>> +
>> + try_it ();
>> + try_it ();
>
> You could use xasprintf and free the pointer.
Please also post the planned commit message. Thanks.
Florian