Changeset 954


Ignore:
Timestamp:
02/16/07 17:56:37 (12 years ago)
Author:
bennylp
Message:

Fixed ticket #106: writing data outside buffer in Win32 error string generation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/os_error_win32.c

    r907 r954  
    195195                             bufsize, 
    196196                             NULL); 
     197        buf[bufsize-1] = '\0'; 
    197198#endif 
    198199 
     
    209210        len = pj_ansi_snprintf( buf, bufsize, "Win32 error code %u",  
    210211                                (unsigned)os_errcode); 
     212        if (len < 0 || len >= (int)bufsize) 
     213            len = bufsize-1; 
    211214        buf[len] = '\0'; 
    212215    } 
Note: See TracChangeset for help on using the changeset viewer.