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>");
