summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/res_mkquery.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/net/res_mkquery.c')
-rw-r--r--lib/libc/net/res_mkquery.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/net/res_mkquery.c b/lib/libc/net/res_mkquery.c
index f079e0d..7ef1ace 100644
--- a/lib/libc/net/res_mkquery.c
+++ b/lib/libc/net/res_mkquery.c
@@ -229,6 +229,8 @@ res_opt(n0, buf, buflen, anslen)
__putshort(T_OPT, cp); /* TYPE */
cp += INT16SZ;
+ if (anslen > 0xffff)
+ anslen = 0xffff; /* limit to 16bit value */
__putshort(anslen & 0xffff, cp); /* CLASS = UDP payload size */
cp += INT16SZ;
*cp++ = NOERROR; /* extended RCODE */
OpenPOWER on IntegriCloud