Use strtok_r instead of strtok for thread safety 72/281572/1 accepted/tizen_7.0_unified_hotfix tizen_7.0_hotfix accepted/tizen/7.0/unified/20221110.063505 accepted/tizen/7.0/unified/hotfix/20221116.110413 accepted/tizen/unified/20220922.114010 tizen_7.0_m2_release
authorDongwoo Lee <dwoo08.lee@samsung.com>
Tue, 20 Sep 2022 03:38:37 +0000 (12:38 +0900)
committerDongwoo Lee <dwoo08.lee@samsung.com>
Tue, 20 Sep 2022 03:40:26 +0000 (12:40 +0900)
Change-Id: I07104009925a0501872ba1ade389704fda1cc305
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
hw/board/board.c

index 10ccf02d095a55a3887e84e6c031dc39a0f861c0..743a8238ead38cf16c21af039a36adc915f4ad07 100644 (file)
@@ -197,6 +197,7 @@ static int set_partition_status(char partition_ab, const char *status)
 
 static int get_partition_status(char partition_ab, char *buffer, const int max_len)
 {
+       char *dummy;
        char *path;
        char target_partition_ab = partition_ab;
 
@@ -226,7 +227,7 @@ static int get_partition_status(char partition_ab, char *buffer, const int max_l
        }
 
        /* remove potential newline | tokenizer will place '\0' in a place of '\n' */
-       strtok(buffer, "\n");
+       strtok_r(buffer, "\n", &dummy);
 
        if (strcmp(buffer, PARTITION_STATUS_OK) != 0 &&
                        strcmp(buffer, PARTITION_STATUS_CORRUPTED) != 0 &&