Python, Linux, and the setuid bit
Grant Edwards
invalid at invalid.invalid
Mon Apr 14 18:07:07 EDT 2014
On 2014-04-14, Grant Edwards <invalid at invalid.invalid> wrote:
> On 2014-04-14, John Gordon <gordon at panix.com> wrote:
>>> char **envp_read;
>>> char **envp_write;
>>
>>> if (envp_write < envp_read)
>>> {
>>> memset(envp_write, 0, ((unsigned int) envp_read -
>>> (unsigned int) envp_write));
>>> }
>>
>> I think it's complaining about casting the char ** objects to unsigned int.
>
> If we assume that the author is trying to clear memory between the
> addresses pointed to by the two variables, then it's probably better
> be cast to (char *) before the subtracted.
Wow, I mangled that sentence. It should have been something like:
then it's probably better to cast them to (char *) before the
subtraction.
memset(envp_write, 0, ((char*)envp_read)-((char*)envp_write));
--
Grant Edwards grant.b.edwards Yow! My mind is making
at ashtrays in Dayton ...
gmail.com
More information about the Python-list
mailing list