[Freeipa-devel] Re: [PATCH] COLLECTION patches resending

Stephen Gallagher sgallagh at redhat.com
Mon Jul 13 12:10:24 UTC 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/10/2009 05:29 PM, Dmitri Pal wrote:
>>>> These unsigned values are the size of the internal stack or depth level.
>>>> They need to  always be positive this is why they are unsigned.
>>>> I do not want obfuscate the error by preventing them to go below 0.
>>>> If it goes the program will crash and we will see the problem.
>>>>       
>> Are you sure that the program will crash or maybe just override some
>> random memory? If you use a macro you can call abort() if the value is
>> 0 and the program will definitely exit.
>>
>>   
> It will become MAX unsigned. Since the variable is used as an index to
> the array it will point to some unrelated memory and program will get
> memory violation.

You cannot and MUST NOT rely on a "memory violation", since it's
possible for you to be working on a machine with copious amounts of
memory, where max unsigned might still be addressable (see PAE kernels
for examples of this). Sumit is correct, you need to do this with a
macro that calls abort() if a program attempts to decrement the stack
counter when it's already zero.

> But the place where it was a problem is in the function that i fixed
> with the second patch.
> 
> Thanks for reviewing!
> 
> Dmitri
> 
> 
> 
> _______________________________________________
> Freeipa-devel mailing list
> Freeipa-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel


- -- 
Stephen Gallagher
RHCE 804006346421761

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkpbJCgACgkQeiVVYja6o6N/bQCdFu5t07PwSEptxQc1RrupSy8y
6c4An1XnlKYtoQ2W6tGRnkM+/59gmxC0
=fGLZ
-----END PGP SIGNATURE-----




More information about the Freeipa-devel mailing list