[PD-cvs] SF.net SVN: pure-data:[10233] trunk/externals/zexy/src/list2lists.c

zmoelnig at users.sourceforge.net zmoelnig at users.sourceforge.net
Mon Aug 4 17:39:57 CEST 2008


Revision: 10233
          http://pure-data.svn.sourceforge.net/pure-data/?rev=10233&view=rev
Author:   zmoelnig
Date:     2008-08-04 15:39:54 +0000 (Mon, 04 Aug 2008)

Log Message:
-----------
fixed bug where negative list-lengths would not be
handled specially, resulting in possible segfaults

Modified Paths:
--------------
    trunk/externals/zexy/src/list2lists.c

Modified: trunk/externals/zexy/src/list2lists.c
===================================================================
--- trunk/externals/zexy/src/list2lists.c	2008-08-04 15:38:50 UTC (rev 10232)
+++ trunk/externals/zexy/src/list2lists.c	2008-08-04 15:39:54 UTC (rev 10233)
@@ -66,7 +66,12 @@
     x->x_lcount=argc;
     x->x_length=(t_int*)getbytes((x->x_lcount)*sizeof(t_int));
     for(i=0; i<argc; i++) {
-      x->x_length[i]=atom_getint(argv+i);
+      int index=atom_getint(argv+i);
+      if(index<0) {
+	pd_error(x, "[list2lists]: clamped negative index=%d to 0!", index);
+	index=0;
+      }
+      x->x_length[i]=index;
     }
   }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Pd-cvs mailing list