Skip to content

Commit 044a905

Browse files
Fix Coverity issue CHECKED_RETURN
lib/pkg_editor/src/pkg_editor.c:1604:3: Type: Unchecked return value from library (CHECKED_RETURN) lib/pkg_editor/src/pkg_editor.c:1584:3: Unchecked call to function 1. path: Condition "buffer != NULL", taking true branch. lib/pkg_editor/src/pkg_editor.c:1585:5: 2. path: Condition "input == NULL", taking true branch. lib/pkg_editor/src/pkg_editor.c:1585:5: 3. path: Falling through to end of if statement. lib/pkg_editor/src/pkg_editor.c:1588:3: 4. path: Falling through to end of if statement. lib/pkg_editor/src/pkg_editor.c:1594:3: 5. path: Condition "ret != 0", taking false branch. lib/pkg_editor/src/pkg_editor.c:1604:3: 6. check_return: Calling "mkdir(full_name, 493U)" without checking return value. This library function may fail and return an error code.
1 parent 11e6399 commit 044a905

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/pkg_editor/src/pkg_editor.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1603,11 +1603,12 @@ static int acl_pkg_unpack_buffer_or_file(const char *buffer, size_t buffer_size,
16031603
return 0;
16041604
}
16051605

1606-
// Create output directory (ignore any errors).
1606+
// Create output directory (ignore any errors to avoid error-prone,
1607+
// platform-dependent error handling).
16071608
#ifdef _WIN32
1608-
CreateDirectory(full_name, NULL);
1609+
(void)CreateDirectory(full_name, NULL);
16091610
#else
1610-
mkdir(full_name, 0755);
1611+
(void)mkdir(full_name, 0755);
16111612
#endif
16121613
full_name[out_dir_length] = '/';
16131614

0 commit comments

Comments
 (0)