Fix read buffer overflow in split_directories

* make-relative-prefix.c (split_directories):
        Return early on empty 'name'

From-SVN: r279068
This commit is contained in:
Tim Ruehsen 2019-12-06 22:20:06 +00:00 committed by Jeff Law
parent 070455950d
commit 1cd4fe3d43
2 changed files with 8 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2019-12-06 Tim Ruehsen <tim.ruehsen@gmx.de>
* make-relative-prefix.c (split_directories):
Return early on empty 'name'
2019-11-16 Tim Ruehsen <tim.ruehsen@gmx.de>
* cp-demangle.c (d_print_init): Remove const from 4th param.

View File

@ -122,6 +122,9 @@ split_directories (const char *name, int *ptr_num_dirs)
const char *p, *q;
int ch;
if (!*name)
return NULL;
/* Count the number of directories. Special case MSDOS disk names as part
of the initial directory. */
p = name;