Merge pull request #1270 from dforsi/fix/segfault

Fix segfaults with malformed input and wrong command line arguments
pull/1273/head
Michael Black 2023-04-11 15:46:56 -05:00 zatwierdzone przez GitHub
commit 6c197dbc1c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 6 dodań i 6 usunięć

Wyświetl plik

@ -1100,7 +1100,7 @@ int ampctl_parse(AMP *my_amp, FILE *fin, FILE *fout, char *argv[], int argc)
rp_getline(pmptstr);
if (!(strcmp(input_line, "")))
if (!input_line || !(strcmp(input_line, "")))
{
fprintf(fout, "? for help, q to quit.\n");
fflush(fout);
@ -1161,7 +1161,7 @@ int ampctl_parse(AMP *my_amp, FILE *fin, FILE *fout, char *argv[], int argc)
rp_getline(pmptstr);
if (!(strcmp(input_line, "")))
if (!input_line || !(strcmp(input_line, "")))
{
fprintf(fout, "? for help, q to quit.\n");
fflush(fout);

Wyświetl plik

@ -1478,7 +1478,7 @@ readline_repeat:
rp_getline(pmptstr);
if (!(strcmp(input_line, "")))
if (!input_line || !(strcmp(input_line, "")))
{
fprintf(fout, "? for help, q to quit.\n");
fflush(fout);
@ -1544,7 +1544,7 @@ readline_repeat:
rp_getline(pmptstr);
if (!(strcmp(input_line, "")))
if (!input_line || !(strcmp(input_line, "")))
{
fprintf(fout, "? for help, q to quit.\n");
fflush(fout);

Wyświetl plik

@ -1160,7 +1160,7 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
rp_getline(pmptstr);
if (!(strcmp(input_line, "")))
if (!input_line || !(strcmp(input_line, "")))
{
fprintf(fout, "? for help, q to quit.\n");
fflush(fout);
@ -1221,7 +1221,7 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
rp_getline(pmptstr);
if (!(strcmp(input_line, "")))
if (!input_line || !(strcmp(input_line, "")))
{
fprintf(fout, "? for help, q to quit.\n");
fflush(fout);