File: 03-avoid-smashed-stack.diff

package info (click to toggle)
textdraw 0.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 260 kB
  • sloc: ansic: 4,705; makefile: 8
file content (31 lines) | stat: -rw-r--r-- 1,051 bytes parent folder | download
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
Author: Wolfram Sang <wsa@kernel.org>
Last-Update: 2026-02-22
Bug-Debian: https://bugs.debian.org/1128731
Description: Fix two problems causing smashed stacks. First, out-of-bounds for terminals
 lager than 200 chars. Second, improper NULL pointer check.
---
 td.c |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Index: textdraw-0.2+ds/td.c
===================================================================
--- textdraw-0.2+ds.orig/td.c
+++ textdraw-0.2+ds/td.c
@@ -20,7 +20,7 @@ Homepage of Textdraw: http://web.uta4you
 #define ENTER 10	// enter key
 #define DEL 330		// del key
 #define MAXOBJECTS 100	// maximum of possible objects
-#define MAXTXTLEN 200	// max string length
+#define MAXTXTLEN 512	// max string length
 
 						/* VARIABLES*/
 int x=0, y=0;
@@ -689,7 +690,7 @@ int main(int argc, char *argv[])			/* MA
 	maxrow-=2; maxcol-=1; menrow=maxrow+1;
 	init();
 
-	if(argv[1]=='\0')	// new file
+	if(!argv[1])		// new file
 	{
 	filename="new";
 	comment("file 'new' opened - to open existing file: <td filename>");