Skip to content

Commit

Permalink
build: add range check for GDT CSIZE
Browse files Browse the repository at this point in the history
  • Loading branch information
dfranusic committed Jan 10, 2022
1 parent 8edd69e commit 26498e8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
2 changes: 1 addition & 1 deletion src/include/gdt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 26498e8

Please sign in to comment.