All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christoph Egger" <Christoph.Egger@amd.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] Fix for figlet
Date: Thu, 14 Sep 2006 19:25:55 +0200	[thread overview]
Message-ID: <200609141925.56727.Christoph.Egger@amd.com> (raw)

[-- 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

                 reply	other threads:[~2006-09-14 17:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200609141925.56727.Christoph.Egger@amd.com \
    --to=christoph.egger@amd.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.