Merge pull request #30 from mdblack98/master

Buffer overflow in rigctl_parse and rotctl_parse
Hamlib-3.1
Nate Bargmann 2016-11-01 19:52:07 -05:00 zatwierdzone przez GitHub
commit bbbbf3c6cd
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 #ifdef HAVE_LIBREADLINE
static char *input_line = (char *)NULL; static char *input_line = (char *)NULL;
static char *result = (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; static const int have_rl = 1;
#ifdef HAVE_READLINE_HISTORY #ifdef HAVE_READLINE_HISTORY
@ -429,6 +429,7 @@ static int scanfc(FILE *fin, const char *format, void *p)
if (errno == EINTR) if (errno == EINTR)
continue; continue;
rig_debug(RIG_DEBUG_ERR, "fscanf: %s\n", strerror(errno)); 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; return ret;
} while(1); } while(1);

Wyświetl plik

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