aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>2000-02-08 11:24:34 +0800
committergreen <green@FreeBSD.org>2000-02-08 11:24:34 +0800
commitb5a965dd5179fe19c9e74112a9ab1df12fe0140b (patch)
tree79d4756de02d2daba28537b8ef17637989671f07 /math
parent7bb3e0eefb95e83340e6214e69e4f57ba6d0f518 (diff)
downloadfreebsd-ports-graphics-b5a965dd5179fe19c9e74112a9ab1df12fe0140b.tar.gz
freebsd-ports-graphics-b5a965dd5179fe19c9e74112a9ab1df12fe0140b.tar.zst
freebsd-ports-graphics-b5a965dd5179fe19c9e74112a9ab1df12fe0140b.zip
Fix a bug that caused a NULL pointer dereference when $HOME is unset
and getpwuid() fails.
Diffstat (limited to 'math')
-rw-r--r--math/calc/files/patch-ae18
1 files changed, 18 insertions, 0 deletions
diff --git a/math/calc/files/patch-ae b/math/calc/files/patch-ae
new file mode 100644
index 00000000000..241bead7693
--- /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 */