Fixed ASAN issue
authorMAYANK HAARIT <mayank.h@samsung.com>
Fri, 15 Nov 2019 06:46:12 +0000 (12:16 +0530)
committersaerome.kim <saerome.kim@samsung.com>
Fri, 15 Nov 2019 10:20:09 +0000 (19:20 +0900)
2. underflow issue: SUMMARY: AddressSanitizer: stack-buffer-overflow
   (/usr/lib/libasan.so+0x3f7b5) in scanf_common(void*, int, bool, char const*,
   std::__va_list)

  This frame has 2 object(s):
   [32, 800) 'entry'
   [832, 1856) 'data' <== Memory access at offset 800 partially underflows this
                          variable

Change-Id: Iff54b5685b731315559e5d7bd2909207c9926c57
Signed-off-by: MAYANK HAARIT <mayank.h@samsung.com>
packaging/ua-plugin-wifi-dummy.spec
src/wifi-networkmanager.c

index 4c36255..127f0b4 100644 (file)
@@ -3,7 +3,7 @@
 
 Name:       ua-plugin-wifi-dummy
 Summary:    Wi-Fi User awareness plugin for VD
-Version:    0.10.1
+Version:    0.10.2
 Release:    1
 License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
index cd1d709..2d54339 100644 (file)
@@ -238,7 +238,7 @@ void __nm_get_linux_arp_table(char *ip_addr, char *mac_addr)
 
        while (fgets(data, sizeof(data) - 1, fp)) {
                nm_linux_arp_entry entry;
-               matches = sscanf(data, "%128s%128s%128s%128s%128s%128s",
+               matches = sscanf(data, "%127s%127s%127s%127s%127s%127s",
                                entry.ip_addr, entry.hw_type, entry.flags, entry.hw_addr,
                                entry.mask, entry.device);