$OpenBSD: patch-src_options_c,v 1.2 2011/07/08 11:25:47 jasper Exp $
--- src/options.c.orig	Mon Jun 23 14:09:08 2003
+++ src/options.c	Fri Jul  8 13:22:30 2011
@@ -141,6 +141,7 @@ name_thumbnail(char *name)
 
    length = strlen(name) + 7;
    new_title = gib_emalloc(length);
+   memset(new_title, 0, sizeof(new_title));
 
    dot_pos = strrchr(name, '.');
    if (dot_pos)
@@ -148,11 +149,11 @@ name_thumbnail(char *name)
       diff = (dot_pos - name) / sizeof(char);
 
       strncpy(new_title, name, diff);
-      strcat(new_title, "-thumb");
-      strcat(new_title, dot_pos);
+      strlcat(new_title, "-thumb", length);
+      strlcat(new_title, dot_pos, length);
    }
    else
-      sprintf(new_title, "%s-thumb", name);
+      snprintf(new_title, length, "%s-thumb", name);
 
    return new_title;
 }
