fixup! Fix some vulnerability (Null Pointer Dereference) defects 08/222308/2 accepted/tizen/5.5/unified/20200116.120709 submit/tizen_5.5/20200115.060610
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 13 Jan 2020 10:21:58 +0000 (19:21 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Tue, 14 Jan 2020 04:46:27 +0000 (13:46 +0900)
Change-Id: Ic82ab59660ba7976789b06bc8da6c61ba5317d21

testsuite/mm_sound_testsuite_simple.c

index 4bfc7fb..f72e2fd 100755 (executable)
@@ -803,6 +803,11 @@ static void interpret(char *cmd)
                        if (basedir != NULL) {
                                entry_len = offsetof(struct dirent, d_name) + fpathconf(dirfd(basedir), MAX_STRING_LEN) + 1;
                                prev_entry = malloc(entry_len);
+                               if (prev_entry == NULL) {
+                                       debug_error("malloc error");
+                                       closedir(basedir);
+                                       break;
+                               }
 
                                while (1) {
                                        int playfail = 0;