Commit c6618683 authored by Mark Andrews's avatar Mark Andrews
Browse files

Add missing range checks in fromtext().

parent 902acbae
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: afsdb_18.c,v 1.25 2000/05/05 05:49:39 marka Exp $ */
/* $Id: afsdb_18.c,v 1.26 2000/05/12 12:59:22 marka Exp $ */
/* Reviewed: Wed Mar 15 14:59:00 PST 2000 by explorer */
......@@ -41,6 +41,8 @@ fromtext_afsdb(dns_rdataclass_t rdclass, dns_rdatatype_t type,
/* subtype */
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
/* hostname */
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cert_37.c,v 1.25 2000/05/05 05:49:40 marka Exp $ */
/* $Id: cert_37.c,v 1.26 2000/05/12 12:59:26 marka Exp $ */
/* Reviewed: Wed Mar 15 21:14:32 EST 2000 by tale */
......@@ -48,6 +48,8 @@ fromtext_cert(dns_rdataclass_t rdclass, dns_rdatatype_t type,
/* key tag */
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
/* algorithm */
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: mx_15.c,v 1.32 2000/05/05 05:49:57 marka Exp $ */
/* $Id: mx_15.c,v 1.33 2000/05/12 12:59:27 marka Exp $ */
/* reviewed: Wed Mar 15 18:05:46 PST 2000 by brister */
......@@ -38,6 +38,8 @@ fromtext_mx(dns_rdataclass_t rdclass, dns_rdatatype_t type,
UNUSED(rdclass);
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rt_21.c,v 1.23 2000/05/05 05:50:05 marka Exp $ */
/* $Id: rt_21.c,v 1.24 2000/05/12 12:59:28 marka Exp $ */
/* reviewed: Thu Mar 16 15:02:31 PST 2000 by brister */
......@@ -40,7 +40,8 @@ fromtext_rt(dns_rdataclass_t rdclass, dns_rdatatype_t type,
UNUSED(rdclass);
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: kx_36.c,v 1.24 2000/05/05 23:20:02 marka Exp $ */
/* $Id: kx_36.c,v 1.25 2000/05/12 12:59:30 marka Exp $ */
/* Reviewed: Thu Mar 16 17:24:54 PST 2000 by explorer */
......@@ -39,6 +39,8 @@ fromtext_in_kx(dns_rdataclass_t rdclass, dns_rdatatype_t type,
REQUIRE(rdclass == 1);
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: naptr_35.c,v 1.24 2000/05/05 23:20:03 marka Exp $ */
/* $Id: naptr_35.c,v 1.25 2000/05/12 12:59:32 marka Exp $ */
/* Reviewed: Thu Mar 16 16:52:50 PST 2000 by bwelling */
......@@ -40,10 +40,14 @@ fromtext_in_naptr(dns_rdataclass_t rdclass, dns_rdatatype_t type,
/* order */
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
/* preference */
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
/* flags */
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: px_26.c,v 1.21 2000/05/05 23:20:08 marka Exp $ */
/* $Id: px_26.c,v 1.22 2000/05/12 12:59:33 marka Exp $ */
/* Reviewed: Mon Mar 20 10:44:27 PST 2000 */
......@@ -40,6 +40,8 @@ fromtext_in_px(dns_rdataclass_t rdclass, dns_rdatatype_t type,
/* preference */
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
/* MAP822 */
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: srv_33.c,v 1.22 2000/05/05 23:20:09 marka Exp $ */
/* $Id: srv_33.c,v 1.23 2000/05/12 12:59:35 marka Exp $ */
/* Reviewed: Fri Mar 17 13:01:00 PST 2000 by bwelling */
......@@ -40,14 +40,20 @@ fromtext_in_srv(dns_rdataclass_t rdclass, dns_rdatatype_t type,
/* priority */
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
/* weight */
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
/* port */
RETERR(gettoken(lexer, &token, isc_tokentype_number, ISC_FALSE));
if (token.value.as_ulong > 0xffff)
return (DNS_R_RANGE);
RETERR(uint16_tobuffer(token.value.as_ulong, target));
/* target */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment