Fix SIGSEGV in doc flavour

OBS-URL: https://build.opensuse.org/package/show/Publishing/gnuplot?expand=0&rev=167
This commit is contained in:
2024-06-03 07:16:46 +00:00
committed by Git OBS Bridge
parent ba133990ff
commit ddb4ce4eeb
4 changed files with 25 additions and 0 deletions

19
gnuplot-doc2tex.patch Normal file
View File

@@ -0,0 +1,19 @@
Do not scan more characters we actual have.
---
docs/doc2tex.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- docs/doc2tex.c
+++ docs/doc2tex.c 2024-06-03 07:11:02.870049141 +0000
@@ -553,8 +553,9 @@ puttex( char *str, FILE *file)
(void) fputs("}", file);
inquote = FALSE;
} else {
+ size_t lmax = strlen(str);
(void) fputs("{\\bf ", file);
- for (i=0; i<MAX_LINE_LEN && ((c=str[i]) != '`') ; i++){
+ for (i=0; i<lmax && ((c=str[i]) != '`') ; i++){
string[i] = c;
}
string[i] = NUL;