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

Gianluca Merlo asteriskteam at digium.com
Mon Mar 21 17:17:29 CDT 2016


Gianluca Merlo has uploaded a new change for review.

  https://gerrit.asterisk.org/2445

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(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/45/2445/1

diff --git a/main/config_options.c b/main/config_options.c
index 5da310f..db99a44 100644
--- a/main/config_options.c
+++ b/main/config_options.c
@@ -1346,7 +1346,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/2445
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96b539336275e0e72a8e8033487d2c3344debd3e
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Gianluca Merlo <gianluca.merlo at gmail.com>



More information about the asterisk-code-review mailing list