[dovecot-cvs] dovecot/src/lib array.h, 1.19, 1.20 module-dir.c, 1.23, 1.24

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


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

Modified Files:
	array.h module-dir.c 
Log Message:
Don't allow giving NULL parameter to array_get() or array_get_modifiable().



Index: array.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/array.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- array.h	16 Sep 2006 13:31:14 -0000	1.19
+++ array.h	16 Sep 2006 13:40:17 -0000	1.20
@@ -146,8 +146,7 @@
 static inline const void *
 _array_get(const struct array *array, unsigned int *count_r)
 {
-	if (count_r != NULL)
-		*count_r = array->buffer->used / array->element_size;
+	*count_r = array->buffer->used / array->element_size;
 	return array->buffer->data;
 }
 #define array_get(array, count) \
@@ -170,8 +169,7 @@
 static inline void *
 _array_get_modifiable(struct array *array, unsigned int *count_r)
 {
-	if (count_r != NULL)
-		*count_r = array->buffer->used / array->element_size;
+	*count_r = array->buffer->used / array->element_size;
 	return buffer_get_modifiable_data(array->buffer, NULL);
 }
 #define array_get_modifiable(array, count) \

Index: module-dir.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/module-dir.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- module-dir.c	10 Sep 2006 12:48:14 -0000	1.23
+++ module-dir.c	16 Sep 2006 13:40:17 -0000	1.24
@@ -195,8 +195,7 @@
 		array_append(&names, &name, 1);
 	}
 
-	names_p = array_get_modifiable(&names, NULL);
-	count = array_count(&names);
+	names_p = array_get_modifiable(&names, &count);
 	qsort(names_p, count, sizeof(const char *), module_name_cmp);
 
 	t_push();



More information about the dovecot-cvs mailing list