|  | 
 |  | 
| 
 | cURL  Mailing List  Monthly Index  Single Mail curl-tracker mailing list Archives
 [ curl-Bugs-2609489 ] vsnprintf called incorrectly in Curl_infof and elsewhere
From: SourceForge.net <noreply_at_sourceforge.net>
 Date: Tue, 17 Feb 2009 23:02:36 +0000 
Bugs item #2609489, was opened at 2009-02-17 17:05
 Please note that this message will contain a full copy of the comment thread,
 Initial Comment:
 ---------BEGIN CODE---------
 However, vsnprintf's return value is defined as follows in the C99 standard:
 "The vsnprintf function returns the number of characters that would have been written
 This means that, in this specific case, if print_buffer is not large enough for the vsnprintf output, then print_buffer will not be null-terminated. When strlen is called a couple of lines later, it will run past the end of print_buffer looking for the terminating null. This is a form of buffer overrun.
 Similar issues exist for other calls to vsnprintf throughout the codebase.
 Recommended fix: get the return value of every call to vsnprintf. Only read from buffer, vnsprintf's first parameter, if the return value is non-negative and less than n, vsnprintf's second parameter. 
 ----------------------------------------------------------------------
 >Comment By: Daniel Stenberg (bagder)
 Message:
 ----------------------------------------------------------------------
 Comment By: Garry Lancaster (gslancaster)
 Message:
 I agree the report is invalid. 
 ----------------------------------------------------------------------
 Comment By: Daniel Stenberg (bagder)
 Message:
 ----------------------------------------------------------------------
 You can respond by visiting: 
 These mail archives are generated by hypermail. | 
 Page updated November 12, 2010.
Page updated November 12, 2010.
web site info