jridky / rpms / nut

Forked from rpms/nut 3 years ago
Clone
e09f2a8
Index: trunk/common/parseconf.c
e09f2a8
===================================================================
e09f2a8
--- trunk/common/parseconf.c	(revision 3487)
e09f2a8
+++ trunk/common/parseconf.c	(revision 3633)
e09f2a8
@@ -171,4 +171,11 @@
e09f2a8
 
e09f2a8
 	wbuflen = strlen(ctx->wordbuf);
e09f2a8
+
e09f2a8
+	/* CVE-2012-2944: only allow the subset Ascii charset from Space to ~ */
e09f2a8
+	if ((ctx->ch < 0x20) || (ctx->ch > 0x7f)) {
e09f2a8
+		fprintf(stderr, "addchar: discarding invalid character (0x%02x)!\n",
e09f2a8
+				ctx->ch);
e09f2a8
+		return;
e09f2a8
+	}
e09f2a8
 
e09f2a8
 	if (ctx->wordlen_limit != 0) {