cvs: /php4 php4dll.dsp /php4/ext/hyperwave hw.c /php4/ext/standard file.c /php4/ext/zlib zlib.c /php4/regex regerror.c
| From: | Andi Gutmans | Date: | Wed, 15 Sep 1999 05:42:36 +0000 |
| Subject: | cvs: /php4 php4dll.dsp /php4/ext/hyperwave hw.c /php4/ext/standard file.c /php4/ext/zlib zlib.c /php4/regex regerror.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-4461@lists.php.net to get a copy of this message | ||
andi Wed Sep 15 01:42:36 1999 EDT
Modified files:
/php4 php4dll.dsp
/php4/ext/hyperwave hw.c
/php4/ext/standard file.c
/php4/ext/zlib zlib.c
/php4/regex regerror.c
Log:
- Thread-unsafe win32 compiles again
- Some strlcpy changes including one bug fix.
Index: php4/php4dll.dsp
diff -u php4/php4dll.dsp:1.15 php4/php4dll.dsp:1.16
--- php4/php4dll.dsp:1.15 Tue Sep 7 16:42:20 1999
+++ php4/php4dll.dsp Wed Sep 15 01:42:34 1999
@@ -153,6 +153,14 @@
SOURCE=.\SAPI.c
# End Source File
+# Begin Source File
+
+SOURCE=.\strlcat.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\strlcpy.c
+# End Source File
# End Group
# Begin Group "Header Files"
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.20 php4/ext/hyperwave/hw.c:1.21
--- php4/ext/hyperwave/hw.c:1.20 Wed Sep 8 08:29:12 1999
+++ php4/ext/hyperwave/hw.c Wed Sep 15 01:42:34 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.20 1999/09/08 12:29:12 steinm Exp $ */
+/* $Id: hw.c,v 1.21 1999/09/15 05:42:34 andi Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
#endif
@@ -579,7 +579,7 @@
}
*ptr1++ = '\n';
*ptr1 = '\0';
- strncpy(str, ptr, 1023);
+ strlcpy(str, ptr, sizeof(str));
}
break;
}
@@ -1663,7 +1663,7 @@
ptr1[-1] = ':';
}
*ptr1 = '\0';
- strncpy(addattribute, ptr, BUFFERLEN);
+ strlcpy(addattribute, ptr, sizeof(addattribute));
noinsert = 0;
}
break;
@@ -1735,7 +1735,7 @@
}
*ptr1++ = '\n';
*ptr1 = '\0';
- strncpy(remattribute, ptr, BUFFERLEN);
+ strlcpy(remattribute, ptr, sizeof(remattribute));
noinsert = 0;
}
break;
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.29 php4/ext/standard/file.c:1.30
--- php4/ext/standard/file.c:1.29 Sun Sep 12 16:36:48 1999
+++ php4/ext/standard/file.c Wed Sep 15 01:42:34 1999
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.29 1999/09/12 20:36:48 zeev Exp $ */
+/* $Id: file.c,v 1.30 1999/09/15 05:42:34 andi Exp $ */
/* Synced with php3 revision 1.218 1999-06-16 [ssb] */
@@ -528,7 +528,7 @@
convert_to_string(arg1);
convert_to_string(arg2);
d = estrndup(arg1->value.str.val,arg1->value.str.len);
- strncpy(p,arg2->value.str.val,sizeof(p));
+ strlcpy(p,arg2->value.str.val,sizeof(p));
t = tempnam(d,p);
efree(d);
Index: php4/ext/zlib/zlib.c
diff -u php4/ext/zlib/zlib.c:1.14 php4/ext/zlib/zlib.c:1.15
--- php4/ext/zlib/zlib.c:1.14 Tue Sep 7 15:05:37 1999
+++ php4/ext/zlib/zlib.c Wed Sep 15 01:42:35 1999
@@ -16,7 +16,7 @@
| Stefan Röhrich <sr@linux.de> |
+----------------------------------------------------------------------+
*/
-/* $Id: zlib.c,v 1.14 1999/09/07 19:05:37 sr Exp $ */
+/* $Id: zlib.c,v 1.15 1999/09/15 05:42:35 andi Exp $ */
#define IS_EXT_MODULE
#include "php.h"
@@ -206,7 +206,7 @@
if(PG(doc_root)) {
snprintf(trypath, MAXPATHLEN, "%s%s", PG(doc_root), filename);
} else {
- strncpy(trypath,filename,MAXPATHLEN);
+ strlcpy(trypath,filename,sizeof(trypath));
}
if (!_php3_checkuid(trypath,2)) {
return(NULL);
Index: php4/regex/regerror.c
diff -u php4/regex/regerror.c:1.1 php4/regex/regerror.c:1.2
--- php4/regex/regerror.c:1.1 Wed Apr 7 17:05:03 1999
+++ php4/regex/regerror.c Wed Sep 15 01:42:35 1999
@@ -94,8 +94,7 @@
if (errbuf_size > len)
(void) strcpy(errbuf, s);
else {
- (void) strncpy(errbuf, s, errbuf_size-1);
- errbuf[errbuf_size-1] = '\0';
+ (void) strlcpy(errbuf, s, errbuf_size);
}
}