pass-hal: standard: Fix overrun issue on bus.c 52/152852/1 accepted/tizen/4.0/unified/20170929.221006 accepted/tizen/unified/20170929.081307 submit/tizen/20170928.043027 submit/tizen_4.0/20170928.011543 tizen_4.0.IoT.p1_release tizen_4.0.m2_release
authorChanwoo Choi <cw00.choi@samsung.com>
Wed, 27 Sep 2017 08:24:43 +0000 (17:24 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Wed, 27 Sep 2017 08:25:57 +0000 (17:25 +0900)
The size of defined character array must need one space (char)
for the last char ('\0'). This patch fixes the overrunt issue
by extending the size of array with +1.

Change-Id: Iec072a0337054c719bfcc59a5f0a29df9386ded4
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
src/bus/bus.c

index 0915a48..65fa232 100644 (file)
@@ -174,7 +174,7 @@ static int standard_dvfs_set_max_freq(char *res_name, int freq)
 static int standard_dvfs_get_available_min_freq(char *res_name)
 {
        char path[PATH_MAX];
-       char buf[MAX_BUF_SIZE];
+       char buf[MAX_BUF_SIZE + 1];
        char *p;
        int ret;
 
@@ -204,7 +204,7 @@ static int standard_dvfs_get_available_min_freq(char *res_name)
 static int standard_dvfs_get_available_max_freq(char *res_name)
 {
        char path[PATH_MAX];
-       char buf[MAX_BUF_SIZE];
+       char buf[MAX_BUF_SIZE + 1];
        char *p;
        int ret;