1ed299
diff --git a/list.c b/list.c
1ed299
index f7359c3..4c3d703 100644
1ed299
--- a/list.c
1ed299
+++ b/list.c
1ed299
@@ -97,7 +97,7 @@ int list_files(__G)    /* return PK-type error code */
1ed299
 {
1ed299
     int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL;
1ed299
 #ifndef WINDLL
1ed299
-    char sgn, cfactorstr[10];
1ed299
+    char sgn, cfactorstr[13];
1ed299
     int longhdr=(uO.vflag>1);
1ed299
 #endif
1ed299
     int date_format;
1ed299
@@ -339,7 +339,19 @@ int list_files(__G)    /* return PK-type error code */
1ed299
                 G.crec.compression_method == ENHDEFLATED) {
1ed299
                 methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3];
1ed299
             } else if (methnum >= NUM_METHODS) {
1ed299
-                sprintf(&methbuf[4], "%03u", G.crec.compression_method);
1ed299
+                /* 2013-02-26 SMS.
1ed299
+                 * http://sourceforge.net/tracker/?func=detail
1ed299
+                 *  &aid=2861648&group_id=118012&atid=679786
1ed299
+                 * Unexpectedly large compression methods overflow
1ed299
+                 * &methbuf[].  Use the old, three-digit decimal format
1ed299
+                 * for values which fit.  Otherwise, sacrifice the
1ed299
+                 * colon, and use four-digit hexadecimal.
1ed299
+                 */
1ed299
+                if (G.crec.compression_method <= 999) {
1ed299
+                    sprintf( &methbuf[ 4], "%03u", G.crec.compression_method);
1ed299
+                } else {
1ed299
+                    sprintf( &methbuf[ 3], "%04X", G.crec.compression_method);
1ed299
+                }
1ed299
             }
1ed299
 
1ed299
 #if 0       /* GRR/Euro:  add this? */