* etags.c (Scheme_functions): Don't loop past a null character (Bug#5601).
[bpt/emacs.git] / lib-src / etags.c
index 2715df8..17aad9a 100644 (file)
@@ -5004,8 +5004,9 @@ Scheme_functions (inf)
       if (strneq (bp, "(def", 4) || strneq (bp, "(DEF", 4))
        {
          bp = skip_non_spaces (bp+4);
-         /* Skip over open parens and white space */
-         while (notinname (*bp))
+         /* Skip over open parens and white space.  Don't continue past
+            '\0'. */
+         while (*bp && notinname (*bp))
            bp++;
          get_tag (bp, NULL);
        }