openbsd-ports/misc/figlet/patches/patch-figlet_c
mbalmer 7f1e33b0c4 - Add a patch to prevent accessing a char[] array with a negative index.
- Bump package name.

Problem reported by Paul de Weerd, ok pvalchev@
2005-08-20 08:01:41 +00:00

16 lines
627 B
Plaintext

$OpenBSD: patch-figlet_c,v 1.1 2005/08/20 08:01:41 mbalmer Exp $
--- figlet.c.orig Sat Aug 13 11:12:19 2005
+++ figlet.c Sat Aug 13 11:20:11 2005
@@ -1444,8 +1444,9 @@ inchr c;
}
else {
for (k=0;k<smushamount;k++) {
- outputline[row][outlinelen-smushamount+k] =
- smushem(outputline[row][outlinelen-smushamount+k],currchar[row][k]);
+ if (outlinelen-smushamount+k >= 0)
+ outputline[row][outlinelen-smushamount+k] =
+ smushem(outputline[row][outlinelen-smushamount+k],currchar[row][k]);
}
strcat(outputline[row],currchar[row]+smushamount);
}