From 546aea23cfe39d261281b95b278a8aa99f19c2c5 Mon Sep 17 00:00:00 2001 From: Jan Friesse Date: Mon, 6 Feb 2012 14:31:53 +0100 Subject: [PATCH] cmap: Check RO flag in adjust int function Signed-off-by: Jan Friesse Reviewed-by: Steven Dake --- exec/cmap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/exec/cmap.c b/exec/cmap.c index 9cff299c..284e8955 100644 --- a/exec/cmap.c +++ b/exec/cmap.c @@ -338,7 +338,12 @@ static void message_handler_req_lib_cmap_adjust_int(void *conn, const void *mess struct res_lib_cmap_adjust_int res_lib_cmap_adjust_int; cs_error_t ret; - ret = icmap_adjust_int((char *)req_lib_cmap_adjust_int->key_name.value, req_lib_cmap_adjust_int->step); + if (icmap_is_key_ro((char *)req_lib_cmap_adjust_int->key_name.value)) { + ret = CS_ERR_ACCESS; + } else { + ret = icmap_adjust_int((char *)req_lib_cmap_adjust_int->key_name.value, + req_lib_cmap_adjust_int->step); + } memset(&res_lib_cmap_adjust_int, 0, sizeof(res_lib_cmap_adjust_int)); res_lib_cmap_adjust_int.header.size = sizeof(res_lib_cmap_adjust_int);