[PATCHv7] nss_db: protect against empty mappings
Florian Weimer
fweimer@redhat.com
Tue Jun 25 21:37:00 GMT 2019
* 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
More information about the Libc-alpha
mailing list