[PATCH] cmap: Handle NULL params in few more functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 lib/cmap.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/lib/cmap.c b/lib/cmap.c
index 35937b7..8a5bed0 100644
--- a/lib/cmap.c
+++ b/lib/cmap.c
@@ -789,6 +789,10 @@ cs_error_t cmap_iter_init(
 	struct req_lib_cmap_iter_init req_lib_cmap_iter_init;
 	struct res_lib_cmap_iter_init res_lib_cmap_iter_init;
 
+	if (cmap_iter_handle == NULL) {
+		return (CS_ERR_INVALID_PARAM);
+	}
+
 	error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
 	if (error != CS_OK) {
 		return (error);
@@ -842,6 +846,10 @@ cs_error_t cmap_iter_next(
 	struct req_lib_cmap_iter_next req_lib_cmap_iter_next;
 	struct res_lib_cmap_iter_next res_lib_cmap_iter_next;
 
+	if (key_name == NULL) {
+		return (CS_ERR_INVALID_PARAM);
+	}
+
 	error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
 	if (error != CS_OK) {
 		return (error);
@@ -938,6 +946,10 @@ cs_error_t cmap_track_add(
 	struct cmap_track_inst *cmap_track_inst;
 	cmap_track_handle_t cmap_track_inst_handle;
 
+	if (cmap_track_handle == NULL || notify_fn == NULL) {
+		return (CS_ERR_INVALID_PARAM);
+	}
+
 	error = hdb_error_to_cs(hdb_handle_get (&cmap_handle_t_db, handle, (void *)&cmap_inst));
 	if (error != CS_OK) {
 		return (error);
-- 
1.7.1

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Index of Archives]     [Linux Clusters]     [Corosync Project]     [Linux USB Devel]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Linux Kernel]     [Linux SCSI]     [X.Org]

  Powered by Linux