openbsd-ports/x11/xtermset/patches/patch-src_xtermset_c
cwen 2e32c1056f xtermset: fix two issues about dealing with configuration files
- Fix array bounds that caused a segfault while storing the config file
- Ensure that we hit EOF while storing/loading the config file on
unsigned char archs (powerpc, arm)

Wording hint and OK tb@
2020-10-13 15:10:39 +00:00

20 lines
590 B
Plaintext

$OpenBSD: patch-src_xtermset_c,v 1.1 2020/10/13 15:10:39 cwen Exp $
Fix array bounds; that caused a segfault while storing the configuration file,
also ensure EOF is properly matched on archs where char is unsigned (ppc, arm)
Index: src/xtermset.c
--- src/xtermset.c.orig
+++ src/xtermset.c
@@ -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,c,style,code,switches[3];
+ char fn[3][MAXFNCHARS-1],*tok;
char line[MAXOPTCHARS+10]; /* ? */
FILE *rcfile=NULL;
argument *argptr = NULL;