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
|
Description: Fix array bounds overruns
Author: David Starner <[email protected]>
Bug-Debian: https://bugs.debian.org/713037
--- xtermset-0.5.2.orig/src/xtermset.c
xtermset-0.5.2/src/xtermset.c
@@ -2,21 2,21 @@
/*
** Copyright (C) 2000 Breyten J. Ernsting <[email protected]>
-**
**
** 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;
}
|