Fix a possible access to uninitialized memory
authorJosé Bollo <jose.bollo@iot.bzh>
Thu, 26 Jan 2017 20:13:11 +0000 (21:13 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Thu, 26 Jan 2017 20:13:11 +0000 (21:13 +0100)
Change-Id: Ica1cf7d81b561ce34039e5212ed6578950f1bfdd
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/wgtpkg-files.c

index 503a84b..cce6a04 100644 (file)
@@ -50,7 +50,7 @@ static unsigned int what_signature(const char *name)
                return UINT_MAX;
 
        len = sizeof(distributor_file_prefix)-1;
-       if (memcmp(name, distributor_file_prefix, len))
+       if (strncmp(name, distributor_file_prefix, len))
                return 0;
        if (name[len] <= '0' || name[len] > '9')
                return 0;