Skip to content

Commit

Permalink
PS-6052: gcc 9.2.1 reports new warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
inikep committed Nov 5, 2019
1 parent 0235a52 commit 5b83a01
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions storage/innobase/os/os0file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1990,6 +1990,11 @@ static char *os_file_get_parent_dir(const char *path) {
return (NULL);
}

/* Make sure that mem_strdupl() will get non-negative "ulint len" */
if (last_slash - path < 0) {
return (NULL);
}

/* Non-trivial directory component */

return (mem_strdupl(path, last_slash - path));
Expand Down

0 comments on commit 5b83a01

Please sign in to comment.