summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorhubertf <hubertf>1998-05-29 02:55:20 +0000
committerhubertf <hubertf>1998-05-29 02:55:20 +0000
commitde1557f1bb8a63e1214b5c99fc8fb620904f8bdd (patch)
tree08807443f99e9a9bf1e263e32a4cfc7fe2d1cbc7 /sysutils
parent914aab29480d71c8be143a0d0bc3c28319a6806f (diff)
downloadpkgsrc-de1557f1bb8a63e1214b5c99fc8fb620904f8bdd.tar.gz
Fix two buffer overruns.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/xosview/patches/patch-ab24
1 files changed, 24 insertions, 0 deletions
diff --git a/sysutils/xosview/patches/patch-ab b/sysutils/xosview/patches/patch-ab
new file mode 100644
index 00000000000..bdc1a879066
--- /dev/null
+++ b/sysutils/xosview/patches/patch-ab
@@ -0,0 +1,24 @@
+--- Xrm.cc.orig Fri May 29 04:34:30 1998
++++ Xrm.cc Fri May 29 04:39:30 1998
+@@ -156,7 +156,7 @@
+ if (xappdir != NULL)
+ {
+ char xappfile[1024];
+- sprintf (xappfile, "%s/%s", xappdir, className());
++ snprintf (xappfile, 1024, "%s/%s", xappdir, className());
+ // this did not work for XAPPLRESDIR
+ //if (!access (xappfile, X_OK | R_OK))
+ if (!access (xappfile, R_OK))
+@@ -185,8 +185,10 @@
+ // Now, check for a user resource file, and merge it in if there is one...
+ if ( getenv( "HOME" ) != NULL ){
+ char userrfilename[1024];
+- strcpy(userrfilename, getenv("HOME"));
+- strcat(userrfilename, "/.Xdefaults");
++#define XDEFAULTS "/.Xdefaults"
++ strncpy(userrfilename, getenv("HOME"), 1024-strlen(XDEFAULTS));
++ strcat(userrfilename, XDEFAULTS);
++#undef XDEFAULTS
+ // User file overrides system (_db).
+ XrmCombineFileDatabase (userrfilename, &_db, 1);
+ }