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: Tue, 25 Jun 2019 23:36:58 +0200
- Subject: Re: [PATCHv7] nss_db: protect against empty mappings
- References: <xnd0j1uzf2.fsf@greed.delorie.com>
* 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.
Thanks,
Florian