From 26498e8bb3855ad11800a018c993debd7eebe752 Mon Sep 17 00:00:00 2001 From: Damir Franusic Date: Mon, 10 Jan 2022 11:22:29 +0100 Subject: [PATCH] build: add range check for GDT CSIZE --- configure.ac | 3 +++ src/include/gdt.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 9fcd319..9bfcc73 100644 --- a/configure.ac +++ b/configure.ac @@ -233,6 +233,9 @@ AC_ARG_WITH(gdt-csize, [AS_HELP_STRING([--with-gdt-csize], [GDT packet buffer size [default = 1024]])], [gdt_csize=$withval], [gdt_csize=1024]) +if (($gdt_csize < 1024 || $gdt_csize > 32768)); then + AC_MSG_ERROR([Invalid GDT packet buffer value (1024 - 32768)]) +fi AC_SUBST(GDT_CSIZE, "$gdt_csize") AC_DEFINE_UNQUOTED([GDT_CSIZE], [$gdt_csize], [GDT packet buffer size]) diff --git a/src/include/gdt.h b/src/include/gdt.h index 119ca5b..54ea344 100644 --- a/src/include/gdt.h +++ b/src/include/gdt.h @@ -704,7 +704,7 @@ namespace gdt { int sctp_len; pollfd fds_lst[1]; int poll_timeout; - unsigned char tmp_buff[8192]; + unsigned char tmp_buff[65536]; sctp_sndrcvinfo rcvinfo; sctp_notification *sctp_ntf; sctp_assoc_change *sctp_assoc;