[PATCH] Implement more export-options (clean, no-export-attributes)

Werner Koch wk at gnupg.org
Fri Jan 17 08:58:58 CET 2014


On Fri, 17 Jan 2014 00:10, daniele.athome at gmail.com said:
> +  a = realloc (a, sizeof *a + strlen (a->arg) + strlen (arg));
> +  if (!a)
> +    return gpg_error_from_syserror ();
> +
> +  strcat (a->arg, arg);
> +
> +  *gpg->argtail = a;
> +  gpg->argtail = &a->next;

This assumes that realloc does not change the value of A.  realloc may
return a pointer to a different memory block.  In turn the predecessor
of the original A will have a dangling pointer.



Shalom-Salam,

   Werner

-- 
Die Gedanken sind frei.  Ausnahmen regelt ein Bundesgesetz.




More information about the Gnupg-devel mailing list