diff options
author | John Beck <John.Beck@Sun.COM> | 2010-04-02 15:17:22 -0700 |
---|---|---|
committer | John Beck <John.Beck@Sun.COM> | 2010-04-02 15:17:22 -0700 |
commit | 4f60987df4dcaa54a88b596f861fbf4f3382c65e (patch) | |
tree | 88de30ce03cee2ecce4e9d30601fa3a2f7f0878a /usr/src | |
parent | 2a417b235e35bd992c3c76d3eb89d35467286133 (diff) | |
download | illumos-joyent-4f60987df4dcaa54a88b596f861fbf4f3382c65e.tar.gz |
6733941 sort -t . dumps core on IP address list
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/cmd/sort/common/fields.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr/src/cmd/sort/common/fields.c b/usr/src/cmd/sort/common/fields.c index 169fbc99bf..6d98515213 100644 --- a/usr/src/cmd/sort/common/fields.c +++ b/usr/src/cmd/sort/common/fields.c @@ -18,13 +18,11 @@ * * CDDL HEADER END */ + /* - * Copyright 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "fields.h" /* @@ -481,6 +479,8 @@ field_boundary_tabbed(field_t *F, line_rec_t *L, int is_end, int is_blanks, } if ((ret = MAX(T - S, 0) + offset) >= L->l_data_length) { + if (L->l_data_length <= 0) + return (0); if (S[L->l_data_length - 1] == delimiter.sc) { return (L->l_data_length - 1); } else { @@ -542,6 +542,8 @@ field_boundary_tabbed_wide(field_t *F, line_rec_t *L, int is_end, int is_blanks, } if ((ret = MAX(T - S, 0) + offset) >= L->l_data_length) { + if (L->l_data_length <= 0) + return (0); if (S[L->l_data_length - 1] == delimiter.wc) { return (L->l_data_length - 1); } else { |