Merge pull request #78 from ryncsn/master

Fix an possible overflow error
This commit is contained in:
PJ Waskiewicz 2018-09-02 13:04:09 -07:00 committed by GitHub
commit 5a1c7b89f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -444,8 +444,8 @@ gboolean sock_handle(gint fd, GIOCondition condition, gpointer user_data __attri
}
if (!strncmp(buff, "setup", strlen("setup"))) {
char banned[512];
char *setup = calloc(strlen("SLEEP ") + 11 +1, 1);
snprintf(setup, 2048, "SLEEP %d ", sleep_interval);
char *setup = calloc(strlen("SLEEP ") + 11 + 1, 1);
snprintf(setup, strlen("SLEEP ") + 11 + 1, "SLEEP %d ", sleep_interval);
if(g_list_length(cl_banned_irqs) > 0) {
for_each_irq(cl_banned_irqs, get_irq_data, setup);
}