shithub: riscv

Download patch

ref: 4cfd5cb02e0969a37f7967088de6dc7642537cd0
parent: 310afb88ef72fcb49b58197d2355243482ee37d5
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Fri Oct 5 19:38:43 EDT 2012

urlencode: encode null bytes

--- a/sys/src/cmd/urlencode.c
+++ b/sys/src/cmd/urlencode.c
@@ -80,7 +80,7 @@
 		}
 	} else {
 		while((c = Bgetc(&bin)) >= 0){
-			if(strchr("/$-_@.!*'(),", c)
+			if(c>0 && strchr("/$-_@.!*'(),", c)
 			|| 'a'<=c && c<='z'
 			|| 'A'<=c && c<='Z'
 			|| '0'<=c && c<='9')
--