1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
Description: Fix out-of-bound memory access
Author: Antti Kuparinen <akuparinen@gmail.com>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=911331
Forwarded: no
Last-Update: 2024-10-16
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/src/execline.c
+++ b/src/execline.c
@@ -457,7 +457,7 @@
txtlen = strlen( firstline );
/* go until we hit an empty line, or reach end of proc.. */
-for( iline = txtstartline; iline <= procstop ; iline++ ) {
+for( iline = txtstartline; iline < procstop ; iline++ ) {
line = PLL.procline[ iline ];
if( line == NULL ) break; /* stmt added scg 1/7/2014 ... bug fix, multiline attribute followed immed by #proc (no blank line) causes instability */
for( i = 0, emptyline = 1; line[i] != '\0'; i++ ) if( !isspace( (int) line[i] )) { emptyline = 0; break; }
@@ -486,7 +486,7 @@
/* now fill mem.. */
-for( iline = txtstartline; iline < txtstopline && iline <= procstop; iline++ ) {
+for( iline = txtstartline; iline < txtstopline; iline++ ) {
line = PLL.procline[ iline ];
/* skip over leading whitespace as well as any leading backslash.. */
--- a/src/proc_line.c
+++ b/src/proc_line.c
@@ -19,7 +19,7 @@
char buf[256];
double x, y, ancx, ancy;
-char *linedetails, *drawpoints;
+char *linedetails, *drawpoints = NULL;
char notation;
char a[40], b[40], c[40], d[40];
int nt, ix, buflen, ancgiven;
|