From 64db41364cc1e517e13058eb729887912d094926 Mon Sep 17 00:00:00 2001 From: Vitaliy Cherepanov Date: Thu, 15 Jan 2015 11:46:51 +0300 Subject: [PATCH] [FIX] prevent issue |-------------------------------|------------------| | Type | Function | |-------------------------------|------------------| | Uninitialized scalar variable | binary_ack_alloc | |-------------------------------|------------------| Change-Id: I10ffe1a9d3cbcd077eb013e2766c9e3b38dac21a Signed-off-by: Vitaliy Cherepanov --- daemon/da_protocol.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/daemon/da_protocol.c b/daemon/da_protocol.c index 8ec2583..f99d0e6 100644 --- a/daemon/da_protocol.c +++ b/daemon/da_protocol.c @@ -835,6 +835,9 @@ static struct binary_ack* binary_ack_alloc(const char *filename) char builddir[PATH_MAX]; char binpath[PATH_MAX]; + builddir[0]='\0'; + binpath[0]='\0'; + if (stat(filename, &decoy) == 0) { ba->type = get_binary_type(filename); @@ -844,8 +847,6 @@ static struct binary_ack* binary_ack_alloc(const char *filename) if (builddir[0] != '\0') snprintf(binpath, sizeof(binpath), check_windows_path(builddir) ? "%s\\%s" : "%s/%s", builddir, basename(filename) ?: ""); - else - binpath[0] = '\0'; ba->binpath = strdup(binpath); get_file_md5sum(ba->digest, filename); -- 2.34.1