Description: guard against possible buffer overflow
Origin: upstream, http://xplanet.svn.sf.net/viewvc/xplanet?view=rev&revision=153
Index: xplanet-1.2.1/src/libimage/bmp.c
===================================================================
--- xplanet-1.2.1.orig/src/libimage/bmp.c	2010-12-02 10:22:16.685718089 -0500
+++ xplanet-1.2.1/src/libimage/bmp.c	2010-12-02 10:22:26.733716913 -0500
@@ -61,10 +61,10 @@
     struct BMPHeader bmph;
 
     /* The length of each line must be a multiple of 4 bytes */
-
     bytesPerLine = (3 * (width + 1) / 4) * 4;
 
-    strcpy(bmph.bfType, "BM");
+    /* copy only "BM" without a terminating null byte */
+    strncpy(bmph.bfType, "BM", 2);
     bmph.bfOffBits = 54;
     bmph.bfSize = bmph.bfOffBits + bytesPerLine * height;
     bmph.bfReserved = 0;
