From 34d1a15307a4cb1f667e8af6ecca523369c436c1 Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sat, 8 Jun 2019 17:24:47 +0200 Subject: [PATCH] fix uninitialized read --- src/comp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/comp.c b/src/comp.c index e46cd5cfecf..44d9a783f0e 100644 --- a/src/comp.c +++ b/src/comp.c @@ -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)) -- 2.39.5