[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: nepomukstrigiservice segfault (was: KDE Software Compilation 4.6.1 has been uploaded to qt-kde.debian.net)

On Sunday 03 April 2011, Sune Vuorela wrote:
> On 2011-04-03, Michael Schuerig <michael@schuerig.de> wrote:
> > nepomukstrigiservice has been happily indexing for 25 minutes now,
> > 21 more than before.
> What kind of changes did you do to the code?

I just removed the (char) cast. I.e.

  decodeQuotedPrintable(q2, (char)(end-q2))


  decodeQuotedPrintable(q2, end-q2)

> > I haven't yet reported this bug at strigi.sf.net, as sourceforge
> > appears to be down right now. It would be nice to have a patch in
> > the debian package soon, even before a new upstream is released.
> I just talked with upstream. He would really like to see the file
> that made you hit this thing.

It was this single line from a mail header


The notable thing about it is that it is quite a bit longer than 127 
characters. See below if you need more convincing.


#include <limits.h>
#include <stdio.h>

int main(void)
    printf("CHAR_MAX:  %d\n",  CHAR_MAX);
    printf("Proper:    %lu\n", (unsigned long)(CHAR_MAX + 1));
    printf("Overflow:  %lu\n", (unsigned long)(char)(CHAR_MAX + 1));
    printf("Negative:  %lu\n", (unsigned long)(char)-(CHAR_MAX + 1));

prints on a 64bit system

CHAR_MAX:  127
Proper:    128
Overflow:  18446744073709551488
Negative:  18446744073709551488

Michael Schuerig

Reply to: