Skip to main content.
home | support | download

Back to List Archive

Re: Bug in swish-2.4.3 on spac64

From: Peter Karman <peter(at)not-real.peknet.com>
Date: Mon Jul 18 2005 - 14:01:36 GMT
Thanks, Sorithy. I just committed your patch to cvs.

SSI scribbled on 7/18/05 3:50 AM:

> Hello,
> 
> I have a bug with "swish-e-2.4.3" on a sparc64.
> I can compile, I can build an index file, but when I want to make a
> search in the result they are some 0 instead of the rank and the
> filesize.
> This pb dont appears on others computers (amd64, x86).
> 
> I look for the pb in the source code and I found the pb in the file
> "docprop.c", they are a bug in the conversion (cast) from a "unsigned
> char propValue[1]" to a "*(unsigned long *)" in the lines 159, 170,
> 522 and 534.
> 
> This bug is also in the current version of swish-e.
> 
> 
> 
> 
> Thank you,
> 
> Sorithy Seng
> Ingénieur Sécurité
> 
> 
> 
> I propose the following patch :
> 
> ----------------------------------------------------------------------------------------------------------------------
> # diff docprop.c.old docprop.c.new
> 61a62,75
> 
>>/*******************************************************************
>>*   Convert a propValue to a unsigned long
>>*
>>********************************************************************/
>>union _conv_ {
>>      char            c[sizeof(unsigned long)];
>>      unsigned long   l;
>>};
>>unsigned long convPropValue2ULong(char *propValue)
>>{
>>      union _conv_ u;
>>      memcpy(u.c, propValue, sizeof(unsigned long));
>>      return u.l;
>>}
> 
> 62a77,79
> 
>>
>>
> 159c176
> <         i = *(unsigned long *) prop->propValue;  /* read binary */
> ---
> 
>>        i = convPropValue2ULong(prop->propValue); /* read binary */
> 
> 170c187
> <         i=*(unsigned long *)prop->propValue;  /* read binary */
> ---
> 
>>        i = convPropValue2ULong(prop->propValue); /* read binary */
> 
> 522c539
> <         i = *(unsigned long *) prop->propValue;  /* read binary */
> ---
> 
>>      i = convPropValue2ULong(prop->propValue); /* read binary */
> 
> 534c551
> <         i = *(unsigned long *) prop->propValue;  /* read binary */
> ---
> 
>>      i = convPropValue2ULong(prop->propValue); /* read binary */

-- 
Peter Karman  .  http://peknet.com/  .  peter(at)not-real.peknet.com
Received on Mon Jul 18 07:01:55 2005