aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2019-04-04 15:28:03 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2019-04-04 16:01:19 +0200
commitf878e8026a9c76311327eb840dc9252e9ed87379 (patch)
tree07f86808ae7b57d451c198c8fe0c4b533cbfb4d2
parentbc8929bec96e81a7f487d5689f52335b435f0e3e (diff)
afb-export: Fix heap corruptionguppy_7.0.1guppy/7.0.17.0.1
The allocated size wasn't correct when 'path' was used. The effect be unseen depending on size and alignment of heap chunks. Change-Id: Id9f85a0078028319491b51bc3e11cd51e4bc3755 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-export.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/afb-export.c b/src/afb-export.c
index 62be9040..a1112d23 100644
--- a/src/afb-export.c
+++ b/src/afb-export.c
@@ -1271,7 +1271,7 @@ static struct afb_export *create(
return NULL;
}
lenapi = strlen(apiname);
- export = calloc(1, sizeof *export + 1 + lenapi + (path == apiname || !path ? 0 : strlen(path)));
+ export = calloc(1, sizeof *export + 1 + lenapi + (path == apiname || !path ? 0 : 1 + strlen(path)));
if (!export)
errno = ENOMEM;
else {