summaryrefslogtreecommitdiffstats
path: root/office/antiword/use-snprintf.patch
diff options
context:
space:
mode:
author titopoquito <titopoquito@gmail.com>2023-12-24 18:44:49 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2023-12-29 18:49:31 +0700
commit04beac00a3839f9f9b38d0b60bdd3948e1a1db48 (patch)
tree2d174d048f1f59fdd9e48cca9d0bcd3b92281d29 /office/antiword/use-snprintf.patch
parentace7c1d61708fc7d77650e0e51fb9dc21d60ddaf (diff)
downloadslackbuilds-04beac00a3839f9f9b38d0b60bdd3948e1a1db48.tar.gz
slackbuilds-04beac00a3839f9f9b38d0b60bdd3948e1a1db48.tar.xz
office/antiword: Update script.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'office/antiword/use-snprintf.patch')
-rw-r--r--office/antiword/use-snprintf.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/office/antiword/use-snprintf.patch b/office/antiword/use-snprintf.patch
new file mode 100644
index 0000000000..b0787fb27a
--- /dev/null
+++ b/office/antiword/use-snprintf.patch
@@ -0,0 +1,36 @@
+Description: Use snprintf
+ Use snprintf() when converting dates to strings to make completely sure we
+ can't overrun the buffer.
+Author: Olly Betts <olly@survex.com>
+Forwarded: no
+Last-Update: 2018-11-29
+
+--- antiword-0.37.orig/summary.c
++++ antiword-0.37/summary.c
+@@ -729,7 +729,7 @@ szGetLastSaveDtm(void)
+ if (pTime == NULL) {
+ return NULL;
+ }
+- sprintf(szTime, "%04d-%02d-%02d",
++ snprintf(szTime, sizeof(szTime), "%04d-%02d-%02d",
+ pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday);
+ return szTime;
+ } /* end of szGetLastSaveDtm */
+@@ -750,7 +750,7 @@ szGetModDate(void)
+ if (pTime == NULL) {
+ return NULL;
+ }
+- sprintf(szTime, "D:%04d%02d%02d%02d%02d",
++ snprintf(szTime, sizeof(szTime), "D:%04d%02d%02d%02d%02d",
+ pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday,
+ pTime->tm_hour, pTime->tm_min);
+ return szTime;
+@@ -772,7 +772,7 @@ szGetCreationDate(void)
+ if (pTime == NULL) {
+ return NULL;
+ }
+- sprintf(szTime, "D:%04d%02d%02d%02d%02d",
++ snprintf(szTime, sizeof(szTime), "D:%04d%02d%02d%02d%02d",
+ pTime->tm_year + 1900, pTime->tm_mon + 1, pTime->tm_mday,
+ pTime->tm_hour, pTime->tm_min);
+ return szTime;