bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] allow file modes up to 7777 instead of 777


From: Martijn Dekker
Subject: Re: [PATCH] allow file modes up to 7777 instead of 777
Date: Thu, 15 Mar 2018 21:11:57 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

Op 14-03-18 om 16:49 schreef Martijn Dekker:
[...]
>      {
>        digits++;
>        result = (result * 8) + (*string++ - '0');
> -      if (result > 0777)
> +      if (result > 07777)
>       return -1;
>      }
> 
> By the way, why does that function repeatedly check the bounds for every
> digit?

It just occurred to me that, given a huge number argument, this
disallows the value to wrap around and return within the bounds.

- M.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]