Added check for null args pointer.
This commit is contained in:
parent
13759f5310
commit
b7108db3c2
@ -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')))
|
||||
|
@ -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')))
|
||||
|
@ -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
|
||||
@ -213,6 +213,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;
|
||||
|
||||
@ -239,6 +242,9 @@ next_enum(FIELD *field, char *args)
|
||||
{
|
||||
enum_args *ta;
|
||||
unsigned cur_choice;
|
||||
|
||||
if (args == NULL)
|
||||
return FALSE;
|
||||
|
||||
ta = (enum_args *) (void *) field->args;
|
||||
|
||||
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
@ -47,6 +47,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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user