[git commit branch/1_28_stable] ash: fix "char == CTLfoo" comparison signedness bug

Denys Vlasenko vda.linux at googlemail.com
Sun Apr 1 11:04:11 UTC 2018


commit: https://git.busybox.net/busybox/commit/?id=78ee8fc3e457452a6cdd25802b85f45b064bb845
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/1_28_stable

It usually does not bite since bbox forces -funsigned-char build.
But for some reason void linux people disabled that.

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 shell/ash.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/shell/ash.c b/shell/ash.c
index 699b6c0ee..881af034d 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -7318,13 +7318,13 @@ hasmeta(const char *p)
 		p = strpbrk(p, chars);
 		if (!p)
 			break;
-		switch ((unsigned char) *p) {
+		switch ((unsigned char)*p) {
 		case CTLQUOTEMARK:
 			for (;;) {
 				p++;
-				if (*p == CTLQUOTEMARK)
+				if ((unsigned char)*p == CTLQUOTEMARK)
 					break;
-				if (*p == CTLESC)
+				if ((unsigned char)*p == CTLESC)
 					p++;
 				if (*p == '\0') /* huh? */
 					return 0;


More information about the busybox-cvs mailing list