bugPSPP - Bugs: bug #47602, Possible seg fault when syntax...

 
 

bug #47602: Possible seg fault when syntax file has no terminating newline.

Submitted by:  John Darrington <jmd>
Submitted on:  Fri 01 Apr 2016 06:48:59 PM UTC  
 
Category: Syntax ParserSeverity: 5 - Average
Status: FixedAssigned to: None
Open/Closed: ClosedRelease: None
Effort: 0.00

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 03 Apr 2016 12:55:11 AM UTC, comment #1:

This would have been easier to debug if the report had mentioned the null byte in the file; I didn't notice it because I was concentrating on the lack of new-line.

Anyway, I fixed this. Thanks for the report!

Ben Pfaff <blp>
Project Administrator
Fri 01 Apr 2016 06:48:59 PM UTC, original submission:

The attached file (which has no trailing newline) shows Invalid Read in valgrind, and sometimes crashes:

Conditional jump or move depends on uninitialised value(s)
==21588== at 0x402FEF5: rawmemchr (vg_replace_strmem.c:1240)
==21588== by 0x4058858: lex_source_get__ (lexer.c:1413)
==21588== by 0x4056888: lex_get (lexer.c:228)
==21588== by 0x4057E48: lex_discard_rest_of_command (lexer.c:1106)
==21588== by 0x4054FD8: do_parse_command (command.c:244)
==21588== by 0x4054C95: cmd_parse_in_state (command.c:148)
==21588== by 0x4054D6B: cmd_parse (command.c:163)
==21588== by 0x804A50D: main (main.c:138)
==21588==
==21588== Invalid read of size 1
==21588== at 0x402FEF3: rawmemchr (vg_replace_strmem.c:1240)
==21588== by 0x4058858: lex_source_get__ (lexer.c:1413)
==21588== by 0x4056888: lex_get (lexer.c:228)
==21588== by 0x4057E48: lex_discard_rest_of_command (lexer.c:1106)
==21588== by 0x4054FD8: do_parse_command (command.c:244)
==21588== by 0x4054C95: cmd_parse_in_state (command.c:148)
==21588== by 0x4054D6B: cmd_parse (command.c:163)
==21588== by 0x804A50D: main (main.c:138)
==21588== Address 0x51db480 is 0 bytes after a block of size 64 alloc'd
==21588== at 0x40291CC: malloc (vg_replace_malloc.c:296)
==21588== by 0x402B378: realloc (vg_replace_malloc.c:692)
==21588== by 0x41FE346: xrealloc (xmalloc.c:61)

John Darrington <jmd>
Project Administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #36822:  dl.sps added by jmd (53B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by blp (Posted a comment)
  • -unavailable- added by jmd (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 03 Apr 2016 12:55:11 AM UTCblpStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Fri 01 Apr 2016 06:48:59 PM UTCjmdAttached File-=>Added dl.sps, #36822

    Back to the top


    Powered by Savane 3.1-cleanup1