File: 02-array-bounds-overruns.patch

package info (click to toggle)
xtermset 0.5.2-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 424 kB
  • sloc: ansic: 582; sh: 330; makefile: 28
file content (90 lines) | stat: -rw-r--r-- 2,652 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
From: David Starner <prosfilaes@gmail.com>
Date: Sun, 24 Aug 2025 01:04:57 +0200
Subject: Fix array bounds overruns

Bug-Debian: https://bugs.debian.org/713037
---
 src/xtermset.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/xtermset.c b/src/xtermset.c
index fd04edd..190ace9 100644
--- a/src/xtermset.c
+++ b/src/xtermset.c
@@ -2,21 +2,21 @@
 
 /*
 ** Copyright (C) 2000 Breyten J. Ernsting <bje@dds.nl>
-**  
+**
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
 ** the Free Software Foundation; either version 2 of the License, or
 ** (at your option) any later version.
-**  
+**
 ** This program is distributed in the hope that it will be useful,
 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 ** GNU General Public License for more details.
-**  
+**
 ** You should have received a copy of the GNU General Public License
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-**  
+**
 */
 
 /* this was orginally 'setxtitle' in the splitvt package,
@@ -33,8 +33,8 @@
 
 int main(int argc, char *argv[])
 {
-    int i,style,code,switches[2];
-    char fn[2][MAXFNCHARS-1],c,*tok;
+    int i,style,code,switches[3];
+    char fn[3][MAXFNCHARS-1],c,*tok;
     char line[MAXOPTCHARS+10]; /* ? */
     FILE *rcfile=NULL;
     argument *argptr = NULL;
@@ -43,7 +43,7 @@ int main(int argc, char *argv[])
        switches[i]=0;
        fn[i][0]='\0';
     }
-    
+
     if(argc<=2) { /* one command line option, make gnu comliant */
        if(argc==1) {
 	  version();
@@ -138,7 +138,7 @@ int main(int argc, char *argv[])
         rcfile = open_rc_file(fn[cswStore],"w");
 
     if(!switches[0]) switches[0] = is_good_term();
-    
+
     argptr = argument_first();
     while(argptr) {
        if(switches[cswStore] && (rcfile!=NULL)) {
@@ -154,18 +154,18 @@ int main(int argc, char *argv[])
                    CHECK {
                        printf(ESC "]%d;%s" BEL, argptr->command,argptr->param);
 		   }
-	       } 
+	       }
 	       break;
            case GeomOption:
                if(strlen(argptr->param)>0) {
 	           CHECK {
-		       set_geom(argptr->param); 
+		       set_geom(argptr->param);
 		   }
                }
 	       break;
 	case ShortOption:
 	       CHECK {
-		   printf(ESC "[%dt", argptr->command); 
+		   printf(ESC "[%dt", argptr->command);
                }
 	       break;
        }