Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting
From: Moritz Jodeit <moritz(at)jodeit.org>
Date: Thu Aug 22 2002 - 05:52:41 EDT


>Number: 2895
>Category: library
>Synopsis: libpcap fix
net
>Environment:
        

	System      : OpenBSD 3.1
	Architecture: OpenBSD.i386
	Machine     : i386

>Description:

When pcap_compile() is called with a bad filter string, all subsequent calls to it will fail too, even if the filter string is correct. This was fixed in revision 1.6 of scanner.l in the FreeBSD tree. The log message says:
	When pcap_compile() detects an error, it longjmp()'s out of the
	scanner/parser. FreeBSD recently made 'flex' its default implementation
	of 'lex'. One of the incompatibilities of 'flex' vs. 'lex' is that
	if you longjmp() out of the scanner, you must call yyrestart()
	before doing another scan (as documented in flex(1)). So add an
	invocation to yyrestart() in lex_init(). This change should be
	backwards compatible with the original 'lex'.

>How-To-Repeat:

One program which is susceptible to this bug is Ethereal.

>Fix:

Index: src/lib/libpcap/scanner.l



RCS file: /cvs/src/lib/libpcap/scanner.l,v retrieving revision 1.12
diff -u -r1.12 scanner.l
--- src/lib/libpcap/scanner.l	23 Mar 2002 01:33:16 -0000	1.12
+++ src/lib/libpcap/scanner.l	22 Aug 2002 09:26:22 -0000
@@ -272,6 +272,7 @@
 	char *buf;
 {
 	in_buffer = buf;
+	yyrestart(NULL);

 }  

 /*

>Release-Note:
Received on Thu Nov 7 16:20:11 2002

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:37 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library