On Tue, Jan 22, 2008 at 08:46:44PM +0100, Adrien Krunch Kunysz wrote:
> abooks terminates with a segmentation fault when the user enters ctrl-d
> at the search prompt. This is because ui_find() assumes ui_readline()
> will never return NULL.
Ah, thanks for noticing that. Great to get some feedback on the package
again after a long time. :)
> I have attached a patch that will avoid the crash. I have also searched
> for other "dangerous" uses of ui_readline() but haven't found any.
Nice - though, the upstream development did chose a different approach,
I took a look at the package in experimental:
#v+
} else {
char *s;
s = ui_readline("/", findstr, MAX_FIELD_LEN - 1, 0);
refresh_screen();
if(s == NULL) {
return; /* user cancelled (ctrl-G) */
} else {
strncpy(findstr, s, MAX_FIELD_LEN);
free(s);
}
#v-
I didn't take a too close look at the code, and am not too sure if your
approach with going on in the function instead of aborting it would be a
right fix, personally I would settle with how upstream did it.
Please give me a call if this would work for you, too. Of course I'll
try it myself, but feedback from you would be nice, too. ;)
So long,
Rhonda
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]