1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 20:15:03 -05:00

hostip.c: fix potential write past the end of string buffer

This commit is contained in:
Yang Tse 2012-01-02 13:44:56 +01:00
parent 8e25d1b93b
commit cc69e56ce3

View File

@ -212,7 +212,7 @@ create_hostcache_id(const char *name, int port)
char *ptr = id; char *ptr = id;
if(ptr) { if(ptr) {
/* lower case the name part */ /* lower case the name part */
while(*ptr != ':') { while(*ptr && (*ptr != ':')) {
*ptr = (char)TOLOWER(*ptr); *ptr = (char)TOLOWER(*ptr);
ptr++; ptr++;
} }