Commit 5d155019 authored by Mark Andrews's avatar Mark Andrews
Browse files

Fix incorrect fix for valid strtol conversion sig_24.h

	Make tests for full string consumption by strtol consistant
	(*e == 0) || (*e != 0)
parent 6af67b3c
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cert_37.c,v 1.1 1999/02/02 01:19:22 marka Exp $ */
/* $Id: cert_37.c,v 1.2 1999/02/02 13:31:44 marka Exp $ */
/* draft-ietf-dnssec-certs-04.txt */
......@@ -59,7 +59,7 @@ fromtext_cert(dns_rdataclass_t class, dns_rdatatype_t type,
/* algorithm */
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
n = strtol(token.value.as_pointer, &e, 10);
if (*e) {
if (*e != 0) {
return (DNS_R_NOTIMPLEMENTED);
} else {
if (n < 0 || n > 0xff)
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: cert_37.h,v 1.1 1999/02/02 01:19:22 marka Exp $ */
/* $Id: cert_37.h,v 1.2 1999/02/02 13:31:44 marka Exp $ */
/* draft-ietf-dnssec-certs-04.txt */
......@@ -59,7 +59,7 @@ fromtext_cert(dns_rdataclass_t class, dns_rdatatype_t type,
/* algorithm */
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
n = strtol(token.value.as_pointer, &e, 10);
if (*e) {
if (*e != 0) {
return (DNS_R_NOTIMPLEMENTED);
} else {
if (n < 0 || n > 0xff)
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: nxt_30.c,v 1.1 1999/01/29 08:04:13 marka Exp $ */
/* $Id: nxt_30.c,v 1.2 1999/02/02 13:31:45 marka Exp $ */
/* RFC 2065 */
......@@ -54,7 +54,7 @@ fromtext_nxt(dns_rdataclass_t class, dns_rdatatype_t type,
if (token.type != isc_tokentype_string)
break;
covered = strtol(token.value.as_pointer, &e, 10);
if (*e == '\0')
if (*e == 0)
(void) NULL;
else if (dns_rdatatype_fromtext(&covered,
&token.value.as_textregion) == DNS_R_UNKNOWN)
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: nxt_30.h,v 1.1 1999/01/29 08:04:13 marka Exp $ */
/* $Id: nxt_30.h,v 1.2 1999/02/02 13:31:45 marka Exp $ */
/* RFC 2065 */
......@@ -54,7 +54,7 @@ fromtext_nxt(dns_rdataclass_t class, dns_rdatatype_t type,
if (token.type != isc_tokentype_string)
break;
covered = strtol(token.value.as_pointer, &e, 10);
if (*e == '\0')
if (*e == 0)
(void) NULL;
else if (dns_rdatatype_fromtext(&covered,
&token.value.as_textregion) == DNS_R_UNKNOWN)
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: sig_24.c,v 1.3 1999/02/02 01:43:47 halley Exp $ */
/* $Id: sig_24.c,v 1.4 1999/02/02 13:31:45 marka Exp $ */
/* RFC 2065 */
......@@ -47,7 +47,7 @@ fromtext_sig(dns_rdataclass_t class, dns_rdatatype_t type,
result = dns_rdatatype_fromtext(&covered, tsr);
if (result != DNS_R_SUCCESS && result != DNS_R_NOTIMPLEMENTED) {
covered = strtol(token.value.as_pointer, &e, 10);
if (e != NULL)
if (*e != 0)
return (result);
}
RETERR(uint16_tobuffer(covered, target));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: sig_24.h,v 1.3 1999/02/02 01:43:47 halley Exp $ */
/* $Id: sig_24.h,v 1.4 1999/02/02 13:31:45 marka Exp $ */
/* RFC 2065 */
......@@ -47,7 +47,7 @@ fromtext_sig(dns_rdataclass_t class, dns_rdatatype_t type,
result = dns_rdatatype_fromtext(&covered, tsr);
if (result != DNS_R_SUCCESS && result != DNS_R_NOTIMPLEMENTED) {
covered = strtol(token.value.as_pointer, &e, 10);
if (e != NULL)
if (*e != 0)
return (result);
}
RETERR(uint16_tobuffer(covered, target));
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: wks_11.c,v 1.6 1999/02/02 01:17:49 halley Exp $ */
/* $Id: wks_11.c,v 1.7 1999/02/02 13:31:46 marka Exp $ */
#ifndef RDATA_IN_1_WKS_11_H
#define RDATA_IN_1_WKS_11_H
......@@ -70,7 +70,7 @@ fromtext_in_wks(dns_rdataclass_t class, dns_rdatatype_t type,
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
proto = strtol(token.value.as_pointer, &e, 10);
if (*e == '\0')
if (*e == 0)
(void)NULL;
else if ((pe = getprotobyname(token.value.as_pointer)) != NULL)
proto = pe->p_proto;
......@@ -93,7 +93,7 @@ fromtext_in_wks(dns_rdataclass_t class, dns_rdatatype_t type,
if (token.type != isc_tokentype_string)
break;
port = strtol(token.value.as_pointer, &e, 10);
if (*e == '\0')
if (*e == 0)
(void) NULL;
else if ((se = getservbyname(token.value.as_pointer, ps))
!= NULL)
......
......@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: wks_11.h,v 1.6 1999/02/02 01:17:49 halley Exp $ */
/* $Id: wks_11.h,v 1.7 1999/02/02 13:31:46 marka Exp $ */
#ifndef RDATA_IN_1_WKS_11_H
#define RDATA_IN_1_WKS_11_H
......@@ -70,7 +70,7 @@ fromtext_in_wks(dns_rdataclass_t class, dns_rdatatype_t type,
RETERR(gettoken(lexer, &token, isc_tokentype_string, ISC_FALSE));
proto = strtol(token.value.as_pointer, &e, 10);
if (*e == '\0')
if (*e == 0)
(void)NULL;
else if ((pe = getprotobyname(token.value.as_pointer)) != NULL)
proto = pe->p_proto;
......@@ -93,7 +93,7 @@ fromtext_in_wks(dns_rdataclass_t class, dns_rdatatype_t type,
if (token.type != isc_tokentype_string)
break;
port = strtol(token.value.as_pointer, &e, 10);
if (*e == '\0')
if (*e == 0)
(void) NULL;
else if ((se = getservbyname(token.value.as_pointer, ps))
!= NULL)
......
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