Menu

#42 print_string_ptr unsafe on platforms with signed char

v1.0 (example)
closed-fixed
nobody
None
5
2015-02-11
2015-02-11
No

print_string_ptr uses escapable[*ptr++] where ptr is a const char* ptr.
escapable is defined as:
static int escapable[256];

On a platform where char is signed escapable[*ptr++] might access memory infront of the escapable array as char goes from -128 to 127

Discussion

  • Dave Gamble

    Dave Gamble - 2015-02-11

    Quite right. Fixed in svn rev68 and current files.

     
  • Dave Gamble

    Dave Gamble - 2015-02-11
    • status: unread --> closed-fixed
     

Log in to post a comment.