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

 
 

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

Submitter:  John Darrington <jmd>
Submitted:  Fri 01 Apr 2016 06:48:59 PM UTC
   
 
Category:  Syntax Parser Severity:  5 - Average
Status:  Fixed Assigned to:  None
Open/Closed:  Closed Release:  None
Effort:  0.00
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>
Group administrator

 

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

Attach Files:
   
   
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
  • -email is unavailable- added by blp (Posted a comment)
  • -email is unavailable- added by jmd (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-04-03 blp StatusNone Fixed
        Open/ClosedOpen Closed
    2016-04-01 jmd Attached File- Added dl.sps, #36822

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code