Text   |  XML   |  ReML   |   Visible Warnings:

Buffer Overrun  at printf-format-fix.c:27

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

fix_format_real

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/printf-format-fix.c)expand/collapse
Show more  
 6  static const char *
 7  fix_format_real(const char *fmt, const char *p, unsigned int *len_r)
 8  {
 9          const char *errstr;
 10          char *buf;
 11          unsigned int len1, len2, len3;
 12   
 13          i_assert((size_t)(p - fmt) < INT_MAX);
 14   
 15          errstr = strerror(errno);
 16   
 17          /* we'll assume that there's only one %m in the format string.
 18             this simplifies the code and there's really no good reason to have
 19             it multiple times. */
 20          len1 = p - fmt;
 21          len2 = strlen(errstr);
 22          len3 = strlen(p + 2);
 23   
 24          /* @UNSAFE */
 25[+]         buf = t_buffer_get(len1 + len2 + len3 + 1);
 26          memcpy(buf, fmt, len1);
 27          memcpy(buf + len1, errstr, len2);
Show more  




Change Warning 7031.24583 : Buffer Overrun

Priority:
State:
Finding:
Owner:
Note: