[dovecot-cvs] dovecot/src/plugins/trash trash-plugin.c,1.10,1.11

cras at dovecot.org cras at dovecot.org
Sat Sep 16 16:40:21 EEST 2006


Update of /var/lib/cvs/dovecot/src/plugins/trash
In directory talvi:/tmp/cvs-serv26830/plugins/trash

Modified Files:
	trash-plugin.c 
Log Message:
Don't allow giving NULL parameter to array_get() or array_get_modifiable().



Index: trash-plugin.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/plugins/trash/trash-plugin.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- trash-plugin.c	10 Sep 2006 12:48:39 -0000	1.10
+++ trash-plugin.c	16 Sep 2006 13:40:18 -0000	1.11
@@ -186,6 +186,7 @@
 	struct istream *input;
 	const char *line, *name;
 	struct trash_mailbox *trash;
+	unsigned int count;
 	int fd;
 
 	fd = open(path, O_RDONLY);
@@ -211,9 +212,8 @@
 	i_stream_destroy(&input);
 	(void)close(fd);
 
-	qsort(array_get_modifiable(&trash_boxes, NULL),
-	      array_count(&trash_boxes), sizeof(struct trash_mailbox),
-	      trash_mailbox_priority_cmp);
+	trash = array_get_modifiable(&trash_boxes, &count);
+	qsort(trash, count, sizeof(*trash), trash_mailbox_priority_cmp);
 	return 0;
 }
 



More information about the dovecot-cvs mailing list