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

Gianluca Merlo asteriskteam at digium.com
Sat Mar 19 07:57:11 CDT 2016


Gianluca Merlo has uploaded a new change for review.

  https://gerrit.asterisk.org/2440

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/40/2440/1

diff --git a/main/config_options.c b/main/config_options.c
index f8c7b0c..e59e5cf 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/2440
To unsubscribe, visit https://gerrit.asterisk.org/settings

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



More information about the asterisk-code-review mailing list