[sword-devel] Segfault from setKeyText, on out of bounds key.

David "Judah's Shadow" Blue yudahsshadow at gmx.com
Mon Mar 1 09:20:31 EST 2021

I'm working on my read command for BIBISH, and I'm getting an odd crash. I've
got the following loop:

for(module->setKeyText(key); !module->popError(); (*module)++) {
            entries += module->getKeyText();
            entries += " - ";
            entries += module->stripText();

If I pass an out of bounds reference such as "Psalm 150" I get a segfault. If
I pass, say, the letter q as my key it chugs for a while figuring out what to
do and then puts me in Eclesiasies ultimately. Is there something I should be
doing to key (it's an SWBuf) to make out of bounds references not crash?

More information about the sword-devel mailing list