Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2007 01:54:46 GMT
From:      Weongyo Jeong <weongyo.jeong@gmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/118295: ndiscvt(8) makes a syntax error when it processes STRING.
Message-ID:  <200711280154.lAS1skGi092058@www.freebsd.org>
Resent-Message-ID: <200711280200.lAS202UK043642@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200711280154.lAS1skGi092058>