]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
config: fix flags in uint option handler 44/2444/1
authorGianluca Merlo <gianluca.merlo@gmail.com>
Sat, 19 Mar 2016 12:34:26 +0000 (13:34 +0100)
committerGianluca Merlo <gianluca.merlo@gmail.com>
Mon, 21 Mar 2016 22:17:14 +0000 (17:17 -0500)
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

main/config_options.c

index 2e6e824934dcd1928a2678b707a385595a149740..d0a8363c6a06fa06a6cf6234c3112a0134f82f7d 100644 (file)
@@ -771,7 +771,7 @@ static int int_handler_fn(const struct aco_option *opt, struct ast_variable *var
  */
 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 ?