shithub: riscv

Download patch

ref: a25758dce7b28c695fc34a70dbb1931bf57905a2
parent: be36fab405e70b01b319cfa3aa2cd2ca8feaf6c6
author: ftrvxmtrx <ftrvxmtrx@gmail.com>
date: Thu Jun 11 18:13:55 EDT 2015

fix strncmp/memcmp used with a wrong number

--- a/sys/src/ape/lib/openssl/apps/req.c
+++ b/sys/src/ape/lib/openssl/apps/req.c
@@ -399,7 +399,7 @@
 			else
 #endif
 #ifndef OPENSSL_NO_DH
-				if (strncmp("dh:",p,4) == 0)
+				if (strncmp("dh:",p,3) == 0)
 				{
 				pkey_type=TYPE_DH;
 				p+=3;
--- a/sys/src/ape/lib/openssl/apps/s_server.c
+++ b/sys/src/ape/lib/openssl/apps/s_server.c
@@ -1975,7 +1975,7 @@
 
 		/* 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;
--- a/sys/src/cmd/dict/roget.c
+++ b/sys/src/cmd/dict/roget.c
@@ -63,7 +63,7 @@
 			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;
 		}
--- a/sys/src/cmd/plumb/rules.c
+++ b/sys/src/cmd/plumb/rules.c
@@ -282,7 +282,7 @@
 				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);
 		}
 	}