From: Sergey Kitov Date: Wed, 31 May 2017 11:32:30 +0000 (+0300) Subject: quota: assertion for *args != NULL is added in order to avoid warning from static... X-Git-Tag: 2.2.31.rc1~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e05d395ef7948c2deaff2b2f61c089bc03d97dab;p=thirdparty%2Fdovecot%2Fcore.git quota: assertion for *args != NULL is added in order to avoid warning from static analyzer and *args[0] changed to (*args)[0] --- diff --git a/src/plugins/quota/quota.c b/src/plugins/quota/quota.c index ea9f379d12..fdce61202e 100644 --- a/src/plugins/quota/quota.c +++ b/src/plugins/quota/quota.c @@ -1373,6 +1373,7 @@ int quota_parse_parameters(struct quota_root *root, const char **args, const cha for (; valid_params->param_name != NULL; ++valid_params) { tmp_param_name = valid_params->param_name; tmp_param_len = strlen(valid_params->param_name); + i_assert(*args != NULL); if (strncmp(*args, tmp_param_name, tmp_param_len) == 0) { tmp_param_val = NULL; *args += tmp_param_len; @@ -1383,9 +1384,9 @@ int quota_parse_parameters(struct quota_root *root, const char **args, const cha t_strdup_until(*args, next_colon); *args = (next_colon == NULL) ? NULL : next_colon + 1; } - else if (*args[0] == '\0' || - *args[0] == ':') { - *args = (*args[0] == ':') ? *args + 1 : NULL; + else if ((*args)[0] == '\0' || + (*args)[0] == ':') { + *args = ((*args)[0] == ':') ? *args + 1 : NULL; /* in case parameter is a boolean second parameter * string parameter value will be ignored by param_handler * we just need some non-NULL value