All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix for figlet
@ 2006-09-14 17:25 Christoph Egger
  0 siblings, 0 replies; only message in thread
From: Christoph Egger @ 2006-09-14 17:25 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 297 bytes --]


Hello!

There's a fix for figlet, which prevents accessing a char[] array with a 
negative index.

The patch applies to xen/tools/figlet/figlet.c
The fix has been taken from the OpenBSD ports tree: 
http://www.openbsd.org/cgi-bin/cvsweb/ports/misc/figlet/patches/patch-figlet_c

It works for me.

[-- Attachment #2: patch-figlet_c --]
[-- Type: text/x-diff, Size: 669 bytes --]

diff -r 2b8dc69744e3 xen/tools/figlet/figlet.c
--- a/xen/tools/figlet/figlet.c	Thu Sep 14 07:55:28 2006 +0100
+++ b/xen/tools/figlet/figlet.c	Wed Sep 13 19:12:28 2006 +0200
@@ -1448,8 +1448,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);
       }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-09-14 17:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-14 17:25 [PATCH] Fix for figlet Christoph Egger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.