Skip to content
Snippets Groups Projects
  • Andy Green's avatar
    a496700b
    lws_snprintf · a496700b
    Andy Green authored
    Thanks to Fabrice Gilot for reporting the problem that led to uncovering this.
    
    Due to a misunderstanding of the return value of snprintf (it is not truncated according
    to the max size passed in) in several places relying on snprintf to truncate the length
    overflows are possible.
    
    This patch wraps snprintf with a new lws_snprintf() which does truncate its length to allow
    the buffer limiting scheme to work properly.
    
    All users should update with these fixes.
    a496700b
    History
    lws_snprintf
    Andy Green authored
    Thanks to Fabrice Gilot for reporting the problem that led to uncovering this.
    
    Due to a misunderstanding of the return value of snprintf (it is not truncated according
    to the max size passed in) in several places relying on snprintf to truncate the length
    overflows are possible.
    
    This patch wraps snprintf with a new lws_snprintf() which does truncate its length to allow
    the buffer limiting scheme to work properly.
    
    All users should update with these fixes.
client-handshake.c 19.61 KiB