summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sci-chemistry/molden/files/molden-4.8-overflow.patch')
-rw-r--r--sci-chemistry/molden/files/molden-4.8-overflow.patch38
1 files changed, 38 insertions, 0 deletions
diff --git a/sci-chemistry/molden/files/molden-4.8-overflow.patch b/sci-chemistry/molden/files/molden-4.8-overflow.patch
new file mode 100644
index 000000000000..7cbd7f436f57
--- /dev/null
+++ b/sci-chemistry/molden/files/molden-4.8-overflow.patch
@@ -0,0 +1,38 @@
+ xwin.c | 10 ++++++----
+ 1 files changed, 6 insertions(+), 4 deletions(-)
+
+diff --git a/xwin.c b/xwin.c
+index f395909..092edff 100644
+--- a/xwin.c
++++ b/xwin.c
+@@ -13552,7 +13552,7 @@ void NewActiveStruct()
+ #ifdef CRAY
+ _fcd ztr;
+ #else
+- char ztr;
++ char ztr[4];
+ #endif
+ #endif
+
+@@ -13650,8 +13650,10 @@ void NewActiveStruct()
+ */
+ clfpstr->ihashz = 0;
+ #else
+- strncpy(&ztr,HetAtm[j],3);
+- parhet_(&j1,&ztr);
++ if (HetAtm[j] != NULL) {
++ strncpy(ztr,HetAtm[j],3);
++ parhet_(&j1,ztr);
++ }
+ #endif
+ #endif
+ }
+@@ -27353,7 +27355,7 @@ char *errstr;
+ UpdateZME();
+ RedrawScroll(&zscroll);
+ }
+- strcpy(ZMEerr,errstr);
++ strncpy(ZMEerr,errstr,MAXZMEERR);
+ RedrawStatus();
+ }
+