mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
(x_basename): fix dereference of null pointer.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
a6c5c82fa0
commit
8c040b46b8
@ -648,6 +648,9 @@ x_basename (const char *s)
|
|||||||
url_delim = g_strrstr (s, VFS_PATH_URL_DELIMITER);
|
url_delim = g_strrstr (s, VFS_PATH_URL_DELIMITER);
|
||||||
path_sep = strrchr (s, PATH_SEP);
|
path_sep = strrchr (s, PATH_SEP);
|
||||||
|
|
||||||
|
if (path_sep == NULL)
|
||||||
|
return s;
|
||||||
|
|
||||||
if (url_delim == NULL
|
if (url_delim == NULL
|
||||||
|| url_delim < path_sep - strlen (VFS_PATH_URL_DELIMITER)
|
|| url_delim < path_sep - strlen (VFS_PATH_URL_DELIMITER)
|
||||||
|| url_delim - s + strlen (VFS_PATH_URL_DELIMITER) < strlen (s))
|
|| url_delim - s + strlen (VFS_PATH_URL_DELIMITER) < strlen (s))
|
||||||
|
Loading…
Reference in New Issue
Block a user