summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-09-17 07:05:25 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-09-17 07:05:25 (GMT)
commitceb7c18c109bff48d5c3327c0ed9209b68540655 (patch)
tree63ca877a8e7d7ef1efd91ee5878ac42609388aee /Modules
parent254eb5380f281923ed26dcaa16f9eb7a654af5a0 (diff)
downloadcpython-ceb7c18c109bff48d5c3327c0ed9209b68540655.zip
cpython-ceb7c18c109bff48d5c3327c0ed9209b68540655.tar.gz
cpython-ceb7c18c109bff48d5c3327c0ed9209b68540655.tar.bz2
Deal with a NULL gr_passwd. Reported by Anders Qvist.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/grpmodule.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Modules/grpmodule.c b/Modules/grpmodule.c
index 8a88968..2882fab 100644
--- a/Modules/grpmodule.c
+++ b/Modules/grpmodule.c
@@ -58,7 +58,12 @@ mkgrent(struct group *p)
#define SET(i,val) PyStructSequence_SET_ITEM(v, i, val)
SET(setIndex++, PyString_FromString(p->gr_name));
- SET(setIndex++, PyString_FromString(p->gr_passwd));
+ if (p->gr_passwd)
+ SET(setIndex++, PyString_FromString(p->gr_passwd));
+ else {
+ SET(setIndex++, Py_None);
+ Py_INCREF(Py_None);
+ }
SET(setIndex++, PyInt_FromLong((long) p->gr_gid));
SET(setIndex++, w);
#undef SET