Fix buffer underflow in add_path
[deliverable/binutils-gdb.git] / gdb / source.c
index 6fc27ae72f78a35da8b6f220e3ea02424a315d35..b6dab6eb236a3db4ff181e1446597edce17526e5 100644 (file)
@@ -537,6 +537,7 @@ add_path (const char *dirname, char **which_path, int parse_separators)
       /* On MS-DOS and MS-Windows, h:\ is different from h: */
             && !(p == name + 3 && name[1] == ':')              /* "d:/" */
 #endif
+            && p > name
             && IS_DIR_SEPARATOR (p[-1]))
        /* Sigh.  "foo/" => "foo" */
        --p;
This page took 0.022681 seconds and 4 git commands to generate.