mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
resolv: Support an exactly sized buffer in ns_name_pack [BZ #21359]
This bug did not affect name resolution because those functions indirectly call ns_name_pack with a buffer which is always larger than the generated query packet, even in the case of the longest-possible domain name.
This commit is contained in:
@ -475,7 +475,7 @@ ns_name_pack(const u_char *src, u_char *dst, int dstsiz,
|
||||
goto cleanup;
|
||||
}
|
||||
n = labellen(srcp);
|
||||
if (dstp + 1 + n >= eob) {
|
||||
if (n + 1 > eob - dstp) {
|
||||
goto cleanup;
|
||||
}
|
||||
memcpy(dstp, srcp, n + 1);
|
||||
|
Reference in New Issue
Block a user