Ulrich Weigand wrote:

>>    len = (sym->generic.len + 3) & ~3;
>>    len += ptr.c[16] + 1;
>>           increment = (len + 3) & ~3;
>
>As Eric already pointed out, this must certainly be interpreted as
>*unsigned* char.  You won't see this bug unless your app contains
>symbols with length >=128 characters ;-)


    Incredible as it sounds, we have symbols that take up to 245 characters
(and surely some of 256).. So I only casted the ptr.c[16] to (unsigned char)
ptr.c[16]. It goes through perfectly now, but I'm wondering if it really is
the length of the symbol name? I put a trace for strlen(symname) and
(unsigned char)ptr.c[16] and they are not often equal...


David

Reply via email to