Added check for null args pointer.

This commit is contained in:
blymn 2001-01-23 01:57:01 +00:00
parent 13759f5310
commit b7108db3c2
6 changed files with 30 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: type_alnum.c,v 1.4 2001/01/21 11:47:09 blymn Exp $ */
/* $NetBSD: type_alnum.c,v 1.5 2001/01/23 01:57:01 blymn Exp $ */
/*-
* Copyright (c) 1998-1999 Brett Lymn
@ -101,6 +101,9 @@ alnum_check_field(FIELD *field, char *args)
buf = args;
start = 0;
if (buf == NULL)
return FALSE;
/* skip leading white space */
while ((buf[start] != '\0')
&& ((buf[start] == ' ') || (buf[start] == '\t')))

View File

@ -1,4 +1,4 @@
/* $NetBSD: type_alpha.c,v 1.4 2001/01/21 11:42:14 blymn Exp $ */
/* $NetBSD: type_alpha.c,v 1.5 2001/01/23 01:57:01 blymn Exp $ */
/*-
* Copyright (c) 1998-1999 Brett Lymn
@ -100,6 +100,9 @@ alpha_check_field(FIELD *field, char *args)
buf = args;
start = 0;
if (buf == NULL)
return FALSE;
/* skip leading white space */
while ((buf[start] != '\0')
&& ((buf[start] == ' ') || (buf[start] == '\t')))

View File

@ -1,4 +1,4 @@
/* $NetBSD: type_enum.c,v 1.3 2001/01/20 11:03:43 blymn Exp $ */
/* $NetBSD: type_enum.c,v 1.4 2001/01/23 01:57:01 blymn Exp $ */
/*-
* Copyright (c) 1998-1999 Brett Lymn
@ -214,6 +214,9 @@ enum_check_field(FIELD *field, char *args)
enum_args *ta;
unsigned match_num;
if (args == NULL)
return FALSE;
ta = (enum_args *) (void *) field->args;
if (match_enum(ta->choices, ta->num_choices, ta->ignore_case,
@ -240,6 +243,9 @@ next_enum(FIELD *field, char *args)
enum_args *ta;
unsigned cur_choice;
if (args == NULL)
return FALSE;
ta = (enum_args *) (void *) field->args;
#ifdef DEBUG
@ -281,6 +287,9 @@ prev_enum(FIELD *field, char *args)
enum_args *ta;
unsigned cur_choice;
if (args == NULL)
return FALSE;
ta = (enum_args *) (void *) field->args;
#ifdef DEBUG

View File

@ -1,4 +1,4 @@
/* $NetBSD: type_integer.c,v 1.2 2001/01/20 11:03:43 blymn Exp $ */
/* $NetBSD: type_integer.c,v 1.3 2001/01/23 01:57:01 blymn Exp $ */
/*-
* Copyright (c) 1998-1999 Brett Lymn
@ -103,6 +103,9 @@ integer_check_field(FIELD *field, char *args)
int precision;
char *buf, *new_buf;
if (args == NULL)
return FALSE;
precision = ((integer_args *) (void *) field->args)->precision;
min = ((integer_args *) (void *) field->args)->min;
max = ((integer_args *) (void *) field->args)->max;

View File

@ -1,4 +1,4 @@
/* $NetBSD: type_ipv4.c,v 1.2 2001/01/20 11:03:43 blymn Exp $ */
/* $NetBSD: type_ipv4.c,v 1.3 2001/01/23 01:57:01 blymn Exp $ */
/*-
* Copyright (c) 1998-1999 Brett Lymn
@ -48,6 +48,9 @@ ipv4_check_field(FIELD *field, char *args)
char *buf, *keeper, *p;
unsigned int vals[4], i;
if (args == NULL)
return FALSE;
if (asprintf(&keeper, "%s", args) < 0)
return FALSE;

View File

@ -1,4 +1,4 @@
/* $NetBSD: type_numeric.c,v 1.2 2001/01/20 11:03:43 blymn Exp $ */
/* $NetBSD: type_numeric.c,v 1.3 2001/01/23 01:57:01 blymn Exp $ */
/*-
* Copyright (c) 1998-1999 Brett Lymn
@ -104,6 +104,9 @@ numeric_check_field(FIELD *field, char *args)
int precision;
char *buf, *new_buf;
if (args == NULL)
return FALSE;
precision = ((numeric_args *) (void *) field->args)->precision;
min = ((numeric_args *) (void *) field->args)->min;
max = ((numeric_args *) (void *) field->args)->max;