Fix potential stack/string overflow warning
authorNelson Ferreira <nelson.ferreira@ieee.org>
Wed, 14 Sep 2011 08:36:00 +0000 (04:36 -0400)
committerNelson Ferreira <nelson.ferreira@ieee.org>
Wed, 14 Sep 2011 08:36:00 +0000 (04:36 -0400)
CID:379

src/symbols.c

index a2441a8..d5c1740 100644 (file)
@@ -3749,7 +3749,8 @@ defsymbol_massage_name_1(Lisp_Object * location, const char *name, int dump_p,
                assert(len + 1 < sizeof(temp));
        else
                assert(len < sizeof(temp));
-       strcpy(temp, name + 1); /* Remove initial Q */
+        temp[0]='\0';
+       strncat(temp, name + 1, sizeof(temp)-1);        /* Remove initial Q */
        if (multiword_predicate_p) {
                 /* Overwrite the 'p' which is the last char of name
                    and put "_p" instead. */