[Asterisk-code-review] config: fix flags in uint option handler (asterisk[11])

Anonymous Coward asteriskteam at digium.com
Mon Mar 21 18:45:55 CDT 2016


Anonymous Coward #1000019 has submitted this change and it was merged.

Change subject: config: fix flags in uint option handler
......................................................................


config: fix flags in uint option handler

The configuration unsigned integer option handler sets flags for the
parser as if the option should be a signed integer (PARSE_INT32),
leading to errors on "out of range" values. Fix flags (PARSE_UINT32).

ASTERISK-25612 #close

Change-Id: I96b539336275e0e72a8e8033487d2c3344debd3e
---
M main/config_options.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Richard Mudgett: Looks good to me, but someone else must approve
  Anonymous Coward #1000019: Verified
  Joshua Colp: Looks good to me, approved



diff --git a/main/config_options.c b/main/config_options.c
index 2e6e824..d0a8363 100644
--- a/main/config_options.c
+++ b/main/config_options.c
@@ -771,7 +771,7 @@
  */
 static int uint_handler_fn(const struct aco_option *opt, struct ast_variable *var, void *obj) {
 	unsigned int *field = (unsigned int *)(obj + opt->args[0]);
-	unsigned int flags = PARSE_INT32 | opt->flags;
+	unsigned int flags = PARSE_UINT32 | opt->flags;
 	int res = 0;
 	if (opt->flags & PARSE_IN_RANGE) {
 		res = opt->flags & PARSE_DEFAULT ?

-- 
To view, visit https://gerrit.asterisk.org/2444
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I96b539336275e0e72a8e8033487d2c3344debd3e
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Gianluca Merlo <gianluca.merlo at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>



More information about the asterisk-code-review mailing list