PR26458 UBSAN: elf32-i386.c:3615 left shift of negative value
[deliverable/binutils-gdb.git] / libiberty / make-relative-prefix.c
index ec0b0ee74940831f760f0c9857b544df23c42baa..e3f9f920df4a2b4a8be00e88727d74a42ed46eea 100644 (file)
@@ -1,5 +1,5 @@
 /* Relative (relocatable) prefix support.
-   Copyright (C) 1987-2019 Free Software Foundation, Inc.
+   Copyright (C) 1987-2020 Free Software Foundation, Inc.
 
 This file is part of libiberty.
 
@@ -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;
This page took 0.022863 seconds and 4 git commands to generate.