aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-03-16 12:38:10 +0000
committerWerner Koch <[email protected]>2015-03-16 12:38:10 +0000
commit119f27032b822ace8c012b96f9e41bcf23251a54 (patch)
treee217d5685574c6307bcc9163a34c218fa2c80927
parentSwitch to automake 1.14 and update build-aux files. (diff)
downloadgpgme-119f27032b822ace8c012b96f9e41bcf23251a54.tar.gz
gpgme-119f27032b822ace8c012b96f9e41bcf23251a54.zip
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.
-rw-r--r--src/engine-spawn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/engine-spawn.c b/src/engine-spawn.c
index 8ffc6280..28a14bed 100644
--- a/src/engine-spawn.c
+++ b/src/engine-spawn.c
@@ -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;