bin/118295: ndiscvt(8) makes a syntax error when it processes
STRING.
Weongyo Jeong
weongyo.jeong at gmail.com
Tue Nov 27 18:00:03 PST 2007
>Number: 118295
>Category: bin
>Synopsis: ndiscvt(8) makes a syntax error when it processes STRING.
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Nov 28 02:00:02 UTC 2007
>Closed-Date:
>Last-Modified:
>Originator: Weongyo Jeong
>Release: FreeBSD 7.0 CURRENT
>Organization:
CDNetworks
>Environment:
FreeBSD freebsd.weongyo.org 7.0-CURRENT FreeBSD 7.0-CURRENT #3: Sun Jun 24 21:47:30 KST 2007 weongyo at bsd.dev1.cdnetworks.co.kr:/usr/obj/usr/src/sys/GENERIC i386
>Description:
In some INF files, we can meet some texts to define a register key like below
"ENUM\"%ZD1211B_50U_PNP%
It makes a ndiscvt(8)'s syntax error when it parses because \" is treated as a character escape sequence.
>How-To-Repeat:
$ cat > t.inf
[UnZDRegistryUSB.reg]
HKLM,SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\UNZD1211B%InterfaceType%,DEL_HKR_0000,0,"ENUM\"%ZD1211B_50U_PNP%
^D
$ ndiscvt -i t.inf -s ZD11BUXP.SYS -o tmp.h
ndiscvt: line 2: %ZD1211B_50U_PNP%: syntax error.
>Fix:
Index: inf-token.l
===================================================================
RCS file: /data/cvs/src/usr.sbin/ndiscvt/inf-token.l,v
retrieving revision 1.3
diff -u -r1.3 inf-token.l
--- inf-token.l 11 Jan 2004 21:10:35 -0000 1.3
+++ inf-token.l 27 Nov 2007 12:25:53 -0000
@@ -67,7 +67,7 @@
\/\/.*$ ;
= { return EQUALS; }
, { return COMMA; }
-\"(\\\"|[^"]|\"\")*\" {
+\"([^"]|\"\")*\" {
int len = strlen(yytext) - 2;
int blen = len + 1;
char *walker;
@@ -94,9 +94,6 @@
while(isspace(yytext[i]))
i++;
break;
- case '\"':
- i++;
- break;
case '(':
i++;
break;
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-bugs
mailing list