- Some strlcpy changes including one bug fix.
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);
}
}
}
*ptr1++ = '\n';
*ptr1 = '\0';
- strncpy(str, ptr, 1023);
+ strlcpy(str, ptr, sizeof(str));
}
break;
}
ptr1[-1] = ':';
}
*ptr1 = '\0';
- strncpy(addattribute, ptr, BUFFERLEN);
+ strlcpy(addattribute, ptr, sizeof(addattribute));
noinsert = 0;
}
break;
}
*ptr1++ = '\n';
*ptr1 = '\0';
- strncpy(remattribute, ptr, BUFFERLEN);
+ strlcpy(remattribute, ptr, sizeof(remattribute));
noinsert = 0;
}
break;
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);
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);
\r
SOURCE=.\SAPI.c\r
# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\strlcat.c\r
+# End Source File\r
+# Begin Source File\r
+\r
+SOURCE=.\strlcpy.c\r
+# End Source File\r
# End Group\r
# Begin Group "Header Files"\r
\r
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);
}
}