Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70237

Re: Python, Linux, and the setuid bit

From Grant Edwards <invalid@invalid.invalid>
Newsgroups comp.lang.python
Subject Re: Python, Linux, and the setuid bit
Date 2014-04-14 22:07 +0000
Organization PANIX Public Access Internet and UNIX, NYC
Message-ID <lihm6a$l3q$2@reader1.panix.com> (permalink)
References <mailman.9260.1397511440.18130.python-list@python.org> <lihlgu$hjk$1@reader1.panix.com> <lihm24$l3q$1@reader1.panix.com>

Show all headers | View raw


On 2014-04-14, Grant Edwards <invalid@invalid.invalid> wrote:
> On 2014-04-14, John Gordon <gordon@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            

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python, Linux, and the setuid bit Ethan Furman <ethan@stoneleaf.us> - 2014-04-14 14:13 -0700
  Re: Python, Linux, and the setuid bit John Gordon <gordon@panix.com> - 2014-04-14 21:55 +0000
    Re: Python, Linux, and the setuid bit Grant Edwards <invalid@invalid.invalid> - 2014-04-14 22:04 +0000
      Re: Python, Linux, and the setuid bit Grant Edwards <invalid@invalid.invalid> - 2014-04-14 22:07 +0000
  Re: Python, Linux, and the setuid bit Richard Kettlewell <rjk@greenend.org.uk> - 2014-04-15 09:00 +0100
    Re: Python, Linux, and the setuid bit Chris Angelico <rosuav@gmail.com> - 2014-04-15 18:15 +1000
      Re: Python, Linux, and the setuid bit Richard Kettlewell <rjk@greenend.org.uk> - 2014-04-15 10:28 +0100
        Re: Python, Linux, and the setuid bit Chris Angelico <rosuav@gmail.com> - 2014-04-15 19:35 +1000
    Re: Python, Linux, and the setuid bit Chris Angelico <rosuav@gmail.com> - 2014-04-15 18:18 +1000

csiph-web