wireshark/tools/lemon
Jörg Mayer a8002aa0b7 Fix two coverity messages:
*** CID 718534:  Dereference before null check  (REVERSE_INULL)
/tools/lemon/lemon.c: 3425 in translate_code()
3419                rp->rhs[i]->index,i-rp->nrhs+1);
3420           }else{
3421             /* No destructor defined for this term */
3422           }
3423         }
3424       }
>>>     CID 718534:  Dereference before null check  (REVERSE_INULL)
>>>     Null-checking "rp->code" suggests that it may be null, but it has already been
+dereferenced on all paths leading to the check.
3425       if( rp->code ){
3426         cp = append_str(0,0,0,0);
3427         rp->code = Strsafe(cp?cp:"");
3428       }
3429     }
3430

*** CID 1156989:  Out-of-bounds read  (OVERRUN)
/tools/lemon/lemon.c: 3139 in tplt_xfer()
3133       int i, iStart;
3134       char line[LINESIZE];
3135       while( fgets(line,LINESIZE,in) && (line[0]!='%' || line[1]!='%') ){
3136         (*lineno)++;
3137         iStart = 0;
3138         if( name ){
>>>     CID 1156989:  Out-of-bounds read  (OVERRUN)
>>>     Overrunning array "line" of 1000 bytes at byte offset 1000 using index "i"
+(which evaluates to 1000).
3139           for(i=0; line[i] && i<LINESIZE; i++){
3140             if( line[i]=='P' && i<(LINESIZE-5) && strncmp(&line[i],"Parse",5)==0
3141               && (i==0 || !safe_isalpha(line[i-1]))
3142             ){
3143               if( i>iStart ) fprintf(out,"%.*s",i-iStart,&line[iStart]);
3144               fprintf(out,"%s",name);

svn path=/trunk/; revision=54849
2014-01-19 17:59:20 +00:00
..
CMakeLists.txt More SVN properties cleanup. 2013-10-27 01:11:15 +00:00
Makefile.am Followup to r45034: Don't define _U_ on the compile line, pull it in from 2012-09-21 21:29:18 +00:00
Makefile.nmake makefile.nmake -> Makefile.nmake and minor whitespace (spaces -> tabs) changes. 2013-06-25 15:32:49 +00:00
README
cppmagic.h
lemon.c Fix two coverity messages: 2014-01-19 17:59:20 +00:00
lemon.html
lemonflex-head.inc
lemonflex-tail.inc
lempar.c Fix lemon FSF address and add license exception for the generated mate grammar 2013-10-18 18:10:46 +00:00

README

$Id$

The Lemon Parser Generator's home page is:

http://www.hwaci.com/sw/lemon/index.html
Lemon seems now to be maintaned at :
http://www.sqlite.org/

The file in this directory, lemon.html, was obtained from:

http://www.hwaci.com/sw/lemon/lemon.html

lemon.c has been modified to include the t= and d= command-line
arguments. The changes were submitted to the Lemon maintainer,
but have not appeared in the official Lemon distribution.