kopia lustrzana https://github.com/Hamlib/Hamlib
Fix segfaults with malformed input and wrong command line arguments
Fixes: NULL dereference. Steps to reproduce: echo L | tests/ampctl echo L | tests/rigctl echo L | tests/rotctlpull/1270/head
rodzic
6c1d83ed86
commit
e11b4bd01c
|
@ -1100,7 +1100,7 @@ int ampctl_parse(AMP *my_amp, FILE *fin, FILE *fout, char *argv[], int argc)
|
||||||
|
|
||||||
rp_getline(pmptstr);
|
rp_getline(pmptstr);
|
||||||
|
|
||||||
if (!(strcmp(input_line, "")))
|
if (!input_line || !(strcmp(input_line, "")))
|
||||||
{
|
{
|
||||||
fprintf(fout, "? for help, q to quit.\n");
|
fprintf(fout, "? for help, q to quit.\n");
|
||||||
fflush(fout);
|
fflush(fout);
|
||||||
|
|
|
@ -1478,7 +1478,7 @@ readline_repeat:
|
||||||
|
|
||||||
rp_getline(pmptstr);
|
rp_getline(pmptstr);
|
||||||
|
|
||||||
if (!(strcmp(input_line, "")))
|
if (!input_line || !(strcmp(input_line, "")))
|
||||||
{
|
{
|
||||||
fprintf(fout, "? for help, q to quit.\n");
|
fprintf(fout, "? for help, q to quit.\n");
|
||||||
fflush(fout);
|
fflush(fout);
|
||||||
|
|
|
@ -1160,7 +1160,7 @@ int rotctl_parse(ROT *my_rot, FILE *fin, FILE *fout, char *argv[], int argc,
|
||||||
|
|
||||||
rp_getline(pmptstr);
|
rp_getline(pmptstr);
|
||||||
|
|
||||||
if (!(strcmp(input_line, "")))
|
if (!input_line || !(strcmp(input_line, "")))
|
||||||
{
|
{
|
||||||
fprintf(fout, "? for help, q to quit.\n");
|
fprintf(fout, "? for help, q to quit.\n");
|
||||||
fflush(fout);
|
fflush(fout);
|
||||||
|
|
Ładowanie…
Reference in New Issue