From: Denys Vlasenko Date: Sat, 3 Jan 2015 20:11:27 +0000 (+0100) Subject: fix a SEGV in previous commit X-Git-Tag: 1_24_0~241 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=402451aa19521908125c9aeeb52e91fd4032948b;p=oweals%2Fbusybox.git fix a SEGV in previous commit Signed-off-by: Denys Vlasenko --- diff --git a/libpwdgrp/pwd_grp.c b/libpwdgrp/pwd_grp.c index 01058d3a1..2392e7d22 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)