Fixed buffer overflow in rigctl_parse and rotctl_parse

Hamlib-3.1
Michael Black 2016-11-01 16:02:15 -05:00
rodzic 199111bcc4
commit 35fda10dfd
2 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -121,7 +121,7 @@ static pthread_mutex_t rig_mutex = PTHREAD_MUTEX_INITIALIZER;
#ifdef HAVE_LIBREADLINE
static char *input_line = (char *)NULL;
static char *result = (char *)NULL;
static char *parsed_input[sizeof(char) * 5];
static char *parsed_input[sizeof(char*) * 5];
static const int have_rl = 1;
#ifdef HAVE_READLINE_HISTORY
@ -429,6 +429,7 @@ static int scanfc(FILE *fin, const char *format, void *p)
if (errno == EINTR)
continue;
rig_debug(RIG_DEBUG_ERR, "fscanf: %s\n", strerror(errno));
rig_debug(RIG_DEBUG_ERR, "fscanf: parsing '%s' with '%s'\n", p, format);
}
return ret;
} while(1);

Wyświetl plik

@ -118,7 +118,7 @@ static pthread_mutex_t rot_mutex = PTHREAD_MUTEX_INITIALIZER;
#ifdef HAVE_LIBREADLINE
static char *input_line = (char *)NULL;
static char *result = (char *)NULL;
static char *parsed_input[sizeof(char) * 7];
static char *parsed_input[sizeof(char*) * 7];
static const int have_rl = 1;
#ifdef HAVE_READLINE_HISTORY
@ -331,6 +331,7 @@ static int scanfc(FILE *fin, const char *format, void *p)
if (errno == EINTR)
continue;
rig_debug(RIG_DEBUG_ERR, "fscanf: %s\n", strerror(errno));
rig_debug(RIG_DEBUG_ERR, "fscanf: parsing '%s' with '%s'\n", p, format);
}
return ret;
} while(1);