ethanmoffat / etheos

[Eth]an's [E]ndless [O]nline [S]erver - fork of eoserv project
zlib License
13 stars 8 forks source link

Fix MSVC debug asserts #56

Closed ethanmoffat closed 1 year ago

ethanmoffat commented 1 year ago

Addresses two asserts that show up when debugging on windows

  1. setsockopt was incorrectly casting the value of 1 to char * and passing this as the optval parameter. Instead, the address of the 1 value is passed
  2. GetNumber during packet reading was incorrectly incrementing beyond the length of the packet, which would cause subsequent calls to copy_n in GetNumber to fail because data was out of bounds.