mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +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 ) {
|
if ( *cur == (char)0x1b ) {
|
||||||
/* Only 0x1b ????? */
|
/* Only 0x1b ????? */
|
||||||
char tmp[3];
|
const int tmpsz = 4;
|
||||||
sprintf(tmp, "=%02X", (int)(unsigned char)*cur);
|
char tmp[tmpsz];
|
||||||
|
snprintf(tmp, tmpsz, "=%02X", (int)(unsigned char)*cur);
|
||||||
memcpy(&line_buf[off], tmp, 3);
|
memcpy(&line_buf[off], tmp, 3);
|
||||||
off += 3;
|
off += 3;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue