Fixes to Coverity defects 83027 and 72714

This commit is contained in:
Markus Makela
2014-11-25 12:09:04 +02:00
parent c38773407c
commit 75e9c30d49
2 changed files with 3 additions and 3 deletions

View File

@ -3048,7 +3048,7 @@ static int find_last_seqno(
for (i=0, p=parts; p->sp_string != NULL; i++, p=p->sp_next) for (i=0, p=parts; p->sp_string != NULL; i++, p=p->sp_next)
{ {
if (snstr != NULL && i == seqnoidx) if (snstr != NULL && i == seqnoidx && strnlen(snstr,NAME_MAX) < NAME_MAX)
{ {
strcat(filename, snstr); /*< add sequence number */ strcat(filename, snstr); /*< add sequence number */
} }
@ -3072,4 +3072,4 @@ static int find_last_seqno(
free(snstr); free(snstr);
return seqno; return seqno;
} }

View File

@ -177,7 +177,7 @@ HTTPD_session *client_data = NULL;
j++; j++;
} }
while (!ISspace(buf[j]) && (i < sizeof(url) - 1) && (j < sizeof(buf) - 1)) { while ((j < sizeof(buf) - 1) && !ISspace(buf[j]) && (i < sizeof(url) - 1)) {
url[i] = buf[j]; url[i] = buf[j];
i++; j++; i++; j++;
} }