@@ -147,11 +162,13 @@ static int partition_add_flag(unsigned lineno, struct part_conf *conf,
                                "flag \'rate\' requires valid value"
                                " - skipped\n", lineno);
        } else if (!strncmp(flag, "scope", len)) {
-               if (!val || (conf->scope = strtoul(val, NULL, 0)) == 0)
+               unsigned int scope;
+               if (!val || (scope = strtoul(val, NULL, 0)) == 0 || scope > 0xF)
                        osm_log(conf->p_log, OSM_LOG_VERBOSE,
                                "PARSE WARN: line %d: "
                                "flag \'scope\' requires valid value"
                                " - skipped\n", lineno);
+               conf->scope_mask |= (1<<scope);

In case when val is NULL scope will be non-initialized and
conf->scope_mask will get a wrong value. And in case of other errors
too...
Yes, there's obviously a missing else.  I'll repost right away.

   Rolf

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to