GUAC-363: Warn of invalid preconnection IDs.
This commit is contained in:
parent
b47cff044e
commit
5d608b3500
@ -780,11 +780,23 @@ int guac_client_init(guac_client* client, int argc, char** argv) {
|
|||||||
/* Preconnection ID */
|
/* Preconnection ID */
|
||||||
settings->preconnection_id = -1;
|
settings->preconnection_id = -1;
|
||||||
if (argv[IDX_PRECONNECTION_ID][0] != '\0') {
|
if (argv[IDX_PRECONNECTION_ID][0] != '\0') {
|
||||||
settings->preconnection_id = atoi(argv[IDX_PRECONNECTION_ID]);
|
|
||||||
|
/* Parse preconnection ID, warn if invalid */
|
||||||
|
int preconnection_id = atoi(argv[IDX_PRECONNECTION_ID]);
|
||||||
|
if (preconnection_id < 0)
|
||||||
|
guac_client_log(client, GUAC_LOG_WARNING,
|
||||||
|
"Ignoring invalid preconnection ID: %i",
|
||||||
|
preconnection_id);
|
||||||
|
|
||||||
|
/* Otherwise, assign specified ID */
|
||||||
|
else {
|
||||||
|
settings->preconnection_id = preconnection_id;
|
||||||
guac_client_log(client, GUAC_LOG_DEBUG,
|
guac_client_log(client, GUAC_LOG_DEBUG,
|
||||||
"Preconnection ID: %i", settings->preconnection_id);
|
"Preconnection ID: %i", settings->preconnection_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* Preconnection BLOB */
|
/* Preconnection BLOB */
|
||||||
settings->preconnection_blob = NULL;
|
settings->preconnection_blob = NULL;
|
||||||
if (argv[IDX_PRECONNECTION_BLOB][0] != '\0') {
|
if (argv[IDX_PRECONNECTION_BLOB][0] != '\0') {
|
||||||
|
Loading…
Reference in New Issue
Block a user