From dceab8ea63dd81195030da0cb21c3b743ca2f34a Mon Sep 17 00:00:00 2001 From: Archie Cobbs Date: Sun, 7 Jan 2001 00:26:32 +0000 Subject: [PATCH] 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'. PR: bin/24116 --- contrib/libpcap/scanner.l | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/libpcap/scanner.l b/contrib/libpcap/scanner.l index 54141499e01..c90d2a8cbc6 100644 --- a/contrib/libpcap/scanner.l +++ b/contrib/libpcap/scanner.l @@ -273,6 +273,7 @@ lex_init(buf) char *buf; { in_buffer = buf; + yyrestart(NULL); } /*