fix strncmp/memcmp used with a wrong number

This commit is contained in:
ftrvxmtrx 2015-06-11 22:13:55 +02:00
parent be36fab405
commit a25758dce7
4 changed files with 4 additions and 4 deletions

View file

@ -399,7 +399,7 @@ int MAIN(int argc, char **argv)
else
#endif
#ifndef OPENSSL_NO_DH
if (strncmp("dh:",p,4) == 0)
if (strncmp("dh:",p,3) == 0)
{
pkey_type=TYPE_DH;
p+=3;

View file

@ -1975,7 +1975,7 @@ static int www_body(char *hostname, int s, unsigned char *context)
/* else we have data */
if ( ((www == 1) && (strncmp("GET ",buf,4) == 0)) ||
((www == 2) && (strncmp("GET /stats ",buf,10) == 0)))
((www == 2) && (strncmp("GET /stats ",buf,11) == 0)))
{
char *p;
X509 *peer;

View file

@ -63,7 +63,7 @@ rogetprintentry(Entry e, int cmd)
spc = 0;
}
if (p < e.end -2 && strncmp(p, "[ ", 4) == 0){ /* twiddle layout */
if (p < e.end -2 && strncmp(p, "[ ", 2) == 0){ /* twiddle layout */
outchars(" [");
continue;
}

View file

@ -282,7 +282,7 @@ dollar(Exec *e, char *s, int *namelen)
return filename(e, e->file);
if(memcmp(s, "type", 4) == 0)
return nonnil(e->msg->type);
if(memcmp(s, "wdir", 3) == 0)
if(memcmp(s, "wdir", 4) == 0)
return nonnil(e->msg->wdir);
}
}