[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minor patch to correct buffer overrun
From: |
Chris Sutcliffe |
Subject: |
Re: Minor patch to correct buffer overrun |
Date: |
Wed, 18 Aug 2010 16:39:09 -0400 |
On 18 August 2010 13:19, Eli Zaretskii wrote:
> Can you explain what exactly was the problem with the original code?
> The value of p was computed earlier as
>
> p = name + strlen (name);
I added:
printf("p: %d\n", p - name + 1);
given that was the value originally used:
memcpy (tem, name, p - name + 1);
when run with the problematic Makefile I supplied earlier, the results
were as follows (all in one run):
p: 2
p: 2
p: 46
p: 20
p: 11
p: 25
p: 43
p: 37
p: 26
p: 29
p: 27
p: 4
p: 5
p: 322
p: 326
p: 327
p: 345
p: 23
p: 27
p: 349
p: 28
p: 350
As you can see, the 259 bytes for 'tem' were significantly exceeded.
Chris
--
Chris Sutcliffe
http://emergedesktop.org
http://www.google.com/profiles/ir0nh34d
- Re: Minor patch to correct buffer overrun, (continued)
- Re: Minor patch to correct buffer overrun, Chris Sutcliffe, 2010/08/18
- Re: Minor patch to correct buffer overrun, Chris Sutcliffe, 2010/08/18
- Re: Minor patch to correct buffer overrun, Eli Zaretskii, 2010/08/18
- Re: Minor patch to correct buffer overrun, Paul Smith, 2010/08/18
- Re: Minor patch to correct buffer overrun, Eli Zaretskii, 2010/08/18
- Re: Minor patch to correct buffer overrun, Eli Zaretskii, 2010/08/18
- Re: Minor patch to correct buffer overrun,
Chris Sutcliffe <=
- Re: Minor patch to correct buffer overrun, Eli Zaretskii, 2010/08/18
- Re: Minor patch to correct buffer overrun, Chris Sutcliffe, 2010/08/18
- Re: Minor patch to correct buffer overrun, Eli Zaretskii, 2010/08/19
- Re: Minor patch to correct buffer overrun, Chris Sutcliffe, 2010/08/19
- Re: Minor patch to correct buffer overrun, Chris Sutcliffe, 2010/08/19
- Re: Minor patch to correct buffer overrun, Eli Zaretskii, 2010/08/19
- Re: Minor patch to correct buffer overrun, Chris Sutcliffe, 2010/08/19
- Re: Minor patch to correct buffer overrun, Paul Smith, 2010/08/19
- Re: Minor patch to correct buffer overrun, Eli Zaretskii, 2010/08/19
- Re: Minor patch to correct buffer overrun, Chris Sutcliffe, 2010/08/19