Fix one byte too short malloc.

* src/engine-spawn.c (add_data): Fix malloc
--

Bummer.  Why did I subtracted one from the size?  Did I assume a
dynamically allocated structure with a string field which was not
going to be used?  Very strange.

Not a real problem though because malloc will anyway round up the
allocation to at least the next word size.

Detected by Stack 0.3.
This commit is contained in:
Werner Koch 2015-03-16 13:38:10 +01:00
parent 428ea76965
commit 119f27032b
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B

View File

@ -120,7 +120,7 @@ add_data (engine_spawn_t esp, gpgme_data_t data, int dup_to, int inbound)
assert (esp);
assert (data);
a = malloc (sizeof *a - 1);
a = malloc (sizeof *a);
if (!a)
return gpg_error_from_syserror ();
a->next = NULL;