Extract numeric string arguments with the correct signedness

There are lots of places where a numeric argument of an argument string
gets extraced as signed long value and then assigned to an unsigned long
variable. If the value in the string was negative, it would not be
detected as invalid (and replaced by the default value), but become a
positive bogus value.

With this patch, numeric values which are supposed to be unsigned get
extracted with the 'ulong_value()' function, which returns the default
value for negative numbers.

Fixes #1472
This commit is contained in:
Christian Prochaska
2015-03-27 14:02:04 +01:00
committed by Norman Feske
parent af2cd7175c
commit 0fd53c7fe4
18 changed files with 27 additions and 27 deletions

View File

@ -1045,7 +1045,7 @@ class Nitpicker::Root : public Genode::Root_component<Session_component>
void _upgrade_session(Session_component *s, const char *args)
{
size_t ram_quota = Arg_string::find_arg(args, "ram_quota").long_value(0);
size_t ram_quota = Arg_string::find_arg(args, "ram_quota").ulong_value(0);
s->upgrade_ram_quota(ram_quota);
}