[git commit] fix a SEGV in previous commit

Denys Vlasenko vda.linux at googlemail.com
Sat Jan 3 20:11:27 UTC 2015


commit: http://git.busybox.net/busybox/commit/?id=402451aa19521908125c9aeeb52e91fd4032948b
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libpwdgrp/pwd_grp.c |    2 +-
 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)


More information about the busybox-cvs mailing list