if (useRadio) {
answer = newtRadioGetCurrent(cbInfo[0].comp);
+ *selections = malloc(sizeof(char *) * 2);
+ if (*selections == NULL)
+ return DLG_ERROR;
+ (*selections)[0] = (*selections)[1] = NULL;
for (i = 0; i < numBoxes; i++)
if (cbInfo[i].comp == answer) {
- *selections = malloc(sizeof(char *) * 2);
- if (*selections == NULL) return DLG_ERROR;
(*selections)[0] = cbInfo[i].tag;
- (*selections)[1] = NULL;
break;
}
} else {
%{_libdir}/libnewt.a
%changelog
+- fix segfault in whiptail when no entry is selected in radiolist
+
* Fri Jun 15 2007 Miroslav Lichvar <mlichvar@redhat.com> - 0.52.7-1
- add support to snack for multiple selection and border in listbox
and cursorAtEnd in entry (patch by Shawn Starr)
case MODE_RADIOLIST:
rc = checkList(text, height, width, optCon, 1, flags, &selections);
if (rc == DLG_OKAY) {
- fprintf(output, "%s", selections[0]);
+ if (selections[0])
+ fprintf(output, "%s", selections[0]);
free(selections);
}
break;