File: 40_fix-doc2tex-oob-read.patch

package info (click to toggle)
gnuplot 6.0.3%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,960 kB
  • sloc: ansic: 95,874; cpp: 7,199; makefile: 2,470; javascript: 2,339; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (19 lines) | stat: -rw-r--r-- 690 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Description: Fix OOB read for doc2tex utility
 This patch fixes an out-of-bound read for doc2tex utility.
Author: Zixing Liu <zixing.liu@canonical.com>
Forwarded: no
Last-Update: 2024-03-12

Index: gnuplot-6.0.3/docs/doc2tex.c
===================================================================
--- gnuplot-6.0.3.orig/docs/doc2tex.c
+++ gnuplot-6.0.3/docs/doc2tex.c
@@ -549,7 +549,7 @@ puttex( char *str, FILE *file)
 		inquote = FALSE;
 	    } else {
 		(void) fputs("{\\bf ", file);
-		for (i=0; i<MAX_LINE_LEN && ((c=str[i]) != '`') ; i++){
+		for (i=0; i<MAX_LINE_LEN && ((c=str[i]) != '`'&& c != '\0') ; i++){
                     string[i] = c;
                 }
 		string[i] = NUL;