mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-12 19:22:41 +00:00
dtcm/RFCMIME: fix a guaranteed buffer overflow
This commit is contained in:
parent
dddca18f9b
commit
4029c5b813
1 changed files with 3 additions and 2 deletions
|
@ -1300,8 +1300,9 @@ writeQPrint(char *buf, const char * bp, const unsigned long bp_len,
|
|||
*/
|
||||
if ( *cur == (char)0x1b ) {
|
||||
/* Only 0x1b ????? */
|
||||
char tmp[3];
|
||||
sprintf(tmp, "=%02X", (int)(unsigned char)*cur);
|
||||
const int tmpsz = 4;
|
||||
char tmp[tmpsz];
|
||||
snprintf(tmp, tmpsz, "=%02X", (int)(unsigned char)*cur);
|
||||
memcpy(&line_buf[off], tmp, 3);
|
||||
off += 3;
|
||||
continue;
|
||||
|
|
Loading…
Reference in a new issue