fix a SEGV in previous commit
authorDenys Vlasenko <vda.linux@googlemail.com>
Sat, 3 Jan 2015 20:11:27 +0000 (21:11 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sat, 3 Jan 2015 20:11:27 +0000 (21:11 +0100)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
libpwdgrp/pwd_grp.c

index 01058d3a1b8a22d1b4d7c7b2feb147eba5d91c14..2392e7d2259fcf806e8cc026cccdeb9f0e89a0a2 100644 (file)
@@ -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)