From cee57053d38490955947ad5f73e7ed7269b5c1cd Mon Sep 17 00:00:00 2001 From: Brian Feldman Date: Tue, 8 Feb 2000 03:24:34 +0000 Subject: Fix a bug that caused a NULL pointer dereference when $HOME is unset and getpwuid() fails. --- math/calc/files/patch-ae | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 math/calc/files/patch-ae (limited to 'math/calc') diff --git a/math/calc/files/patch-ae b/math/calc/files/patch-ae new file mode 100644 index 000000000000..241bead76932 --- /dev/null +++ b/math/calc/files/patch-ae @@ -0,0 +1,18 @@ +--- lib_calc.c.orig Mon Feb 7 22:08:08 2000 ++++ lib_calc.c Mon Feb 7 22:10:42 2000 +@@ -407,9 +407,13 @@ + if (ent == NULL) { + /* just assume . is home if all else fails */ + home = "."; ++ } else { ++ home = (char *)malloc(strlen(ent->pw_dir)+1); ++ if (home == NULL) ++ home = "."; ++ else ++ strcpy(home, ent->pw_dir); + } +- home = (char *)malloc(strlen(ent->pw_dir)+1); +- strcpy(home, ent->pw_dir); + } + + /* determine the $PAGER value */ -- cgit v1.2.3