mirror of
https://github.com/openNDS/openNDS.git
synced 2026-05-04 03:01:32 -04:00
Fixed an overflow issue in BinVoucher command line when path to BinVoucher is long enough
This commit is contained in:
@@ -167,7 +167,6 @@ http_nodogsplash_first_contact(request *r)
|
||||
s_config *config;
|
||||
const char *redir;
|
||||
char *origurl;
|
||||
char cmd_buff[255];
|
||||
char *data = NULL;
|
||||
int seconds;
|
||||
|
||||
@@ -201,6 +200,7 @@ http_nodogsplash_first_contact(request *r)
|
||||
/* Don't serve splash, just authenticate */
|
||||
http_nodogsplash_callback_action(r,authtarget,AUTH_MAKE_AUTHENTICATED);
|
||||
} else if (config->enable_preauth) {
|
||||
char cmd_buff[strlen(config->bin_voucher)+strlen(client->mac)+14];
|
||||
snprintf(cmd_buff, sizeof(cmd_buff) - 1, "%s auth_status %s",
|
||||
config->bin_voucher, client->mac);
|
||||
data = system_exec(cmd_buff);
|
||||
@@ -347,7 +347,7 @@ http_nodogsplash_callback_auth(httpd *webserver, request *r)
|
||||
s_config *config;
|
||||
t_client *client;
|
||||
t_auth_target *authtarget;
|
||||
char /**ip, *mac,*/ *msg = NULL, cmd_buff[255], *data = NULL;
|
||||
char /**ip, *mac,*/ *msg = NULL, *data = NULL;
|
||||
int seconds;
|
||||
|
||||
client = http_nodogsplash_add_client(r);
|
||||
@@ -366,6 +366,7 @@ http_nodogsplash_callback_auth(httpd *webserver, request *r)
|
||||
if (!authtarget->voucher || !http_isAlphaNum(authtarget->voucher))
|
||||
goto serve_splash;
|
||||
|
||||
char cmd_buff[strlen(config->bin_voucher)+strlen(client->mac)+strlen(authtarget->voucher)+16];
|
||||
snprintf(cmd_buff, sizeof(cmd_buff) - 1, "%s auth_voucher %s %s",
|
||||
config->bin_voucher, client->mac, authtarget->voucher);
|
||||
data = system_exec(cmd_buff);
|
||||
|
||||
Reference in New Issue
Block a user