bugGNU gettext - Bugs: bug #47531, One byte heap buffer overflow in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #47531: One byte heap buffer overflow in x-lua.c (triggered by make check)

Submitter:  Hanno Boeck <hanno>
Submitted:  Fri 25 Mar 2016 01:02:44 PM UTC
   
 
Category:  Lua Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fix Released Privacy:  Public
Assigned to:  ueno Open/Closed:  Closed

Discussion

Fri 25 Mar 2016 07:24:45 PM UTC, comment #1: 

Thanks, I have pushed the patch:
http://git.savann ... c773b563c2b4c99a4

Daiki Ueno <ueno>
Group administrator
Fri 25 Mar 2016 01:02:44 PM UTC, original submission:  

There is a one byte heap buffer overflow in x-lua.c. This is the code:

static void
string_end ()
{
  string_buf[string_buf_length] = '\0';
}


The problem is that when string_buf_length is larger than string_buf it will still write. In the function above (string_add) there is a check for that and a call to xrealloc in that case. See attached patch for a similar change to string_end (I realloc only one additional byte because I assume after string_end no more memory is needed).

This was found by running the test suite (make check) with address sanitizer enabled. I'll attach the address sanitizer error message as well.

Hanno Boeck <hanno>

 

Attached Files

Attached Files

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by hanno (Submitted the item)
  •  

    Votes

    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.

     

    History

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-27 haible CategoryNone Lua
        Assigned toNone ueno
    2016-03-25 ueno StatusNone Fixed
        Open/ClosedOpen Closed
    2016-03-25 hanno Attached File- Added gettext-fix-bufferoverflow.diff, #36761
        Attached File- Added gettext-lua-overflow-asan.txt, #36762

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code