summaryrefslogtreecommitdiff
path: root/libpwdgrp/pwd_grp.c
diff options
context:
space:
mode:
authorDenys Vlasenko2015-01-03 21:11:27 +0100
committerDenys Vlasenko2015-01-03 21:11:27 +0100
commit402451aa19521908125c9aeeb52e91fd4032948b (patch)
tree14b549ac661d137ba3d138beb7dad227ada82999 /libpwdgrp/pwd_grp.c
parentf9936676bb7fd57ea2256af2247c970d1ed3f906 (diff)
downloadbusybox-402451aa19521908125c9aeeb52e91fd4032948b.zip
busybox-402451aa19521908125c9aeeb52e91fd4032948b.tar.gz
fix a SEGV in previous commit
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libpwdgrp/pwd_grp.c')
-rw-r--r--libpwdgrp/pwd_grp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c
index 01058d3..2392e7d 100644
--- a/libpwdgrp/pwd_grp.c
+++ b/libpwdgrp/pwd_grp.c
@@ -223,7 +223,7 @@ static char *parse_common(FILE *fp, const char *filename,
* for 3 pointers: alignment padding, group name, NULL.
* +1 for every additional group.
*/
- if (n_fields == sizeof(GR_DEF)-1) { /* if we read group file... */
+ if (buf && n_fields == sizeof(GR_DEF)-1) { /* if we read group file... */
int cnt = 3;
char *p = buf;
while (p < S.tokenize_end)