Re: [sword-devel] crashes with ciphering code

2006-11-29 Thread Joachim Ansorg
Hi, I found a fix, so it's working for me now. Change line 261 of src/modules/common/zverse.cpp to this: if (size > 0 && (start < strlen(cacheBuf))) { Line 263 accessed the cacheBuf char array without checking for the size before. So if the uncompressing failed (strlen(cacheBuf) is 0 or

Re: [sword-devel] crashes with ciphering code

2006-11-28 Thread Martin Gruner
Hi DM and everybody. I changed the line to: strncpy(*buf, cacheBlock->getEntry(entry), size); (*buf)[size]='\0'; But it didn't work. Still crashes. I believe I found the reason though. As I assumed many months ago, the reading process works like this: decryption -> decompression

Re: [sword-devel] crashes with ciphering code

2006-11-27 Thread DM Smith
Joachim Ansorg wrote: >> zStr::getCompressedText calls >> strcpy(*buf, cacheBlock->getEntry(entry)); >> > > My fix for this would be (without digging deep into the sources) in line 438 > of zstr.cpp: > strncpy(*buf, cacheBlock->getEntry(entry), size); > This takes me way back. I

Re: [sword-devel] crashes with ciphering code

2006-11-27 Thread Joachim Ansorg
> zStr::getCompressedText calls > strcpy(*buf, cacheBlock->getEntry(entry)); My fix for this would be (without digging deep into the sources) in line 438 of zstr.cpp: strncpy(*buf, cacheBlock->getEntry(entry), size); strcpy expects a \0-terminated string. If the deciphering with the

[sword-devel] crashes with ciphering code

2006-11-27 Thread Martin Gruner
Hi Troy. I wrote you that we are having difficulties with BibleTime's stability since we use my dumb "check that the entered cipher key is valid" function, which basically just calls (*m_module) = sword::TOP; QString test = QString::fromLatin1( m_module->getRawEntryBuf().c_str() ); These line