Update version number and copyright year.
[exim.git] / src / src / spool_in.c
index e878b34eac6295d891d92f24cc55ff5bb429db99..b4506c8aff022186d14c2d9394ed5af752674ba5 100644 (file)
@@ -1,10 +1,10 @@
-/* $Cambridge: exim/src/src/spool_in.c,v 1.17 2006/10/10 11:15:12 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_in.c,v 1.19 2007/01/08 10:50:18 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2006 */
+/* Copyright (c) University of Cambridge 1995 - 2007 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 /* Functions for reading spool files. When compiling for a utility (eximon),
@@ -436,11 +436,14 @@ for (;;)
     else if (Ustrncmp(p, "cl ", 3) == 0)
       {
       int index, count;
-      uschar name[4];
+      uschar name[20];   /* Need plenty of space for %d format */
       tree_node *node;
       if (sscanf(CS big_buffer + 5, "%d %d", &index, &count) != 2)
         goto SPOOL_FORMAT_ERROR;
-      (void) string_format(name, 4, "%c%d", (index < 10 ? 'c' : 'm'), index);
+      if (index < 10)
+        (void) string_format(name, sizeof(name), "%c%d", 'c', index);
+      else if (index < 20) /* ignore out-of-range index */
+        (void) string_format(name, sizeof(name), "%c%d", 'm', index - 10);
       node = acl_var_create(name);
       node->data.ptr = store_get(count + 1);
       if (fread(node->data.ptr, 1, count+1, f) < count) goto SPOOL_READ_ERROR;