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 */
Received on Mon Jul 18 01:53:31 2005