Lines 1291-1299
static void nak(int error)
Link Here
|
1291 |
pe->e_msg = strerror(error - 100); |
1291 |
pe->e_msg = strerror(error - 100); |
1292 |
tp->th_code = EUNDEF; /* set 'undef' errorcode */ |
1292 |
tp->th_code = EUNDEF; /* set 'undef' errorcode */ |
1293 |
} |
1293 |
} |
1294 |
strcpy(tp->th_msg, pe->e_msg); |
|
|
1295 |
length = (int)strlen(pe->e_msg); |
1294 |
length = (int)strlen(pe->e_msg); |
1296 |
tp->th_msg[length] = '\0'; |
1295 |
|
|
|
1296 |
/* we use memcpy() instead of strcpy() in order to avoid buffer overflow |
1297 |
* report from glibc with FORTIFY_SOURCE */ |
1298 |
memcpy(tp->th_msg, pe->e_msg, length + 1); |
1297 |
length += 5; |
1299 |
length += 5; |
1298 |
if (swrite(peer, &buf.storage[0], length) != length) |
1300 |
if (swrite(peer, &buf.storage[0], length) != length) |
1299 |
logmsg("nak: fail\n"); |
1301 |
logmsg("nak: fail\n"); |
1300 |
- |
|
|