]> granicus.if.org Git - php/commitdiff
Avoiding strcpy usage, Make static analyzer happy
authorXinchen Hui <laruence@php.net>
Tue, 9 Aug 2011 09:35:42 +0000 (09:35 +0000)
committerXinchen Hui <laruence@php.net>
Tue, 9 Aug 2011 09:35:42 +0000 (09:35 +0000)
ext/ereg/regex/regerror.c

index 00009a93c15a5e59e278ebecb129a97ff8e3e445..f8c3ca3538f1374cf85832c6f9c7b14aae8eb009 100644 (file)
@@ -82,7 +82,7 @@ size_t errbuf_size)
        
                if (errcode&REG_ITOA) {
                        if (r->code >= 0)
-                               (void) strcpy(convbuf, r->name);
+                               (void) strncpy(convbuf, r->name, 50);
                        else
                                sprintf(convbuf, "REG_0x%x", target);
                        assert(strlen(convbuf) < sizeof(convbuf));