Do not step over the edge of the buffer (check for '\0'). This just happens

to not lose on i386 because another buffer appears immediately following.
Regress tests all passed.
This commit is contained in:
heas 2004-03-14 21:12:14 +00:00
parent 55965d25ad
commit 2a3d05aa4e
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: fields.c,v 1.17 2004/02/15 12:41:25 jdolecek Exp $ */
/* $NetBSD: fields.c,v 1.18 2004/03/14 21:12:14 heas Exp $ */
/*-
* Copyright (c) 2000-2003 The NetBSD Foundation, Inc.
@ -73,7 +73,7 @@
#include "sort.h"
#ifndef lint
__RCSID("$NetBSD: fields.c,v 1.17 2004/02/15 12:41:25 jdolecek Exp $");
__RCSID("$NetBSD: fields.c,v 1.18 2004/03/14 21:12:14 heas Exp $");
__SCCSID("@(#)fields.c 8.1 (Berkeley) 6/6/93");
#endif /* not lint */
@ -85,7 +85,7 @@ __SCCSID("@(#)fields.c 8.1 (Berkeley) 6/6/93");
#define NEXTCOL(pos) { \
if (!SEP_FLAG) \
while (BLANK & l_d_mask[*(++pos)]); \
while (!((FLD_D | REC_D_F) & l_d_mask[*++pos])); \
while ((*(pos+1) != '\0') && !((FLD_D | REC_D_F) & l_d_mask[*++pos]));\
}
static u_char *enterfield __P((u_char *, u_char *, struct field *, int));