mirror of
https://github.com/php/php-src.git
synced 2024-12-03 23:05:57 +08:00
Avoiding strcpy usage, Make static analyzer happy
This commit is contained in:
parent
7402dee014
commit
571427c7db
12
ext/ereg/regex.patch
Normal file
12
ext/ereg/regex.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -u regex.orig/regerror.c regex/regerror.c
|
||||
--- regex.orig/regerror.c 2011-08-09 17:31:11.000000000 +0800
|
||||
+++ regex/regerror.c 2011-08-09 17:29:53.000000000 +0800
|
||||
@@ -82,7 +82,7 @@
|
||||
|
||||
if (errcode®_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));
|
@ -82,7 +82,7 @@ size_t errbuf_size)
|
||||
|
||||
if (errcode®_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));
|
||||
|
Loading…
Reference in New Issue
Block a user