Fix Coverity warnings in neutrinordp
The automated Coverity scan does not currently include neutrinordp Two problems fixed:- 1) MAX_STATIC_CHANNELS at 31 is bigger than freerdp->sessings->channels (16) 2) pamusername in the mod parameters is assumed to be 256 bytes when it is written to.
This commit is contained in:
@@ -1790,6 +1790,10 @@ lfreerdp_synchronize(rdpContext *context)
|
||||
static boolean
|
||||
lfreerdp_pre_connect(freerdp *instance)
|
||||
{
|
||||
#define MAX_FREERDP_CHANNELS \
|
||||
(sizeof(instance->settings->channels) / \
|
||||
sizeof(instance->settings->channels[0]))
|
||||
|
||||
struct mod *mod;
|
||||
int index;
|
||||
int error;
|
||||
@@ -1797,7 +1801,7 @@ lfreerdp_pre_connect(freerdp *instance)
|
||||
int target_chan;
|
||||
int ch_flags;
|
||||
char ch_name[256];
|
||||
const char *ch_names[MAX_STATIC_CHANNELS];
|
||||
const char *ch_names[MAX_FREERDP_CHANNELS];
|
||||
char *dst_ch_name;
|
||||
|
||||
LOG_DEVEL(LOG_LEVEL_INFO, "lfreerdp_pre_connect:");
|
||||
@@ -1828,7 +1832,7 @@ lfreerdp_pre_connect(freerdp *instance)
|
||||
LOG(LOG_LEVEL_INFO, "Channel '%s' not passed to module",
|
||||
ch_name);
|
||||
}
|
||||
else if (target_chan < MAX_STATIC_CHANNELS)
|
||||
else if (target_chan < MAX_FREERDP_CHANNELS)
|
||||
{
|
||||
dst_ch_name = instance->settings->channels[target_chan].name;
|
||||
ch_names[target_chan] = dst_ch_name;
|
||||
|
||||
Reference in New Issue
Block a user