[PATCH 4/6] cmap: Handle NULL in [i]cmap_set_string value

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

 



Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
---
 exec/icmap.c |    4 ++++
 lib/cmap.c   |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/exec/icmap.c b/exec/icmap.c
index 4fd8d66..d51a972 100644
--- a/exec/icmap.c
+++ b/exec/icmap.c
@@ -447,6 +447,10 @@ cs_error_t icmap_set_double(const char *key_name, double value)
 cs_error_t icmap_set_string(const char *key_name, const char *value)
 {
 
+	if (value == NULL) {
+		return (CS_ERR_INVALID_PARAM);
+	}
+
 	return (icmap_set(key_name, value, strlen(value), ICMAP_VALUETYPE_STRING));
 }
 
diff --git a/lib/cmap.c b/lib/cmap.c
index da0b53d..1a58541 100644
--- a/lib/cmap.c
+++ b/lib/cmap.c
@@ -428,6 +428,11 @@ cs_error_t cmap_set_double(cmap_handle_t handle, const char *key_name, double va
 
 cs_error_t cmap_set_string(cmap_handle_t handle, const char *key_name, const char *value)
 {
+
+	if (value == NULL) {
+		return (CS_ERR_INVALID_PARAM);
+	}
+
 	return (cmap_set(handle, key_name, value, strlen(value), CMAP_VALUETYPE_STRING));
 }
 
-- 
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