]> git.eshelyaron.com Git - emacs.git/commitdiff
fix uninitialized read
authorAndrea Corallo <andrea_corallo@yahoo.it>
Sat, 8 Jun 2019 15:24:47 +0000 (17:24 +0200)
committerAndrea Corallo <akrl@sdf.org>
Wed, 1 Jan 2020 10:33:40 +0000 (11:33 +0100)
src/comp.c

index e46cd5cfecff5601609bd97a3f380553c460da6f..44d9a783f0ee520602a12dd4857ad7f5fcc5a432 100644 (file)
@@ -1355,9 +1355,13 @@ DEFUN ("native-compile", Fnative_compile, Snative_compile,
 
   /* FIXME how many other characters are not allowed in C?
      This will introduce name clashs too. */
-  for (int i; i < strlen(c_f_name); i++)
-    if (c_f_name[i] == '-')
-      c_f_name[i] = '_';
+  char *c = c_f_name;
+  while (*c)
+    {
+      if (*c == '-')
+       *c = '_';
+      ++c;
+    }
 
   func = indirect_function (func);
   if (!COMPILEDP (func))