From 119f27032b822ace8c012b96f9e41bcf23251a54 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 16 Mar 2015 13:38:10 +0100 Subject: [PATCH] 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. --- src/engine-spawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;