$OpenBSD: patch-src_flash_c,v 1.1 2011/03/14 22:27:02 jasper Exp $

Fix buffer overflow due to incorrect strncat() usage.
http://savannah.nongnu.org/bugs/?29049

--- src/flash.c.orig	Mon Mar 14 23:23:00 2011
+++ src/flash.c	Mon Mar 14 23:25:14 2011
@@ -252,7 +252,7 @@ flash_dump_core (Flash *flash, FILE * f_core)
             line[0] = '\0';
         }
         snprintf (buf, 80, "%04x ", flash_read (flash, i));
-        strncat (line, buf, 80);
+        strncat (line, buf, 80 - strlen(line) - 1);
     }
     if (dup > 0)
     {
