Parcourir la source

Assert on correct parameters (#1505)

This also fixes debug build
Marcin Kolny il y a 3 ans
Parent
commit
c072b5172c
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      core/shared/platform/common/posix/posix_socket.c

+ 2 - 1
core/shared/platform/common/posix/posix_socket.c

@@ -551,7 +551,8 @@ os_socket_set_linger(bh_socket_t socket, bool is_enabled, int linger_s)
 int
 int
 os_socket_get_linger(bh_socket_t socket, bool *is_enabled, int *linger_s)
 os_socket_get_linger(bh_socket_t socket, bool *is_enabled, int *linger_s)
 {
 {
-    assert(time_s);
+    assert(is_enabled);
+    assert(linger_s);
 
 
     struct linger linger_opts;
     struct linger linger_opts;
     socklen_t linger_opts_len = sizeof(linger_opts);
     socklen_t linger_opts_len = sizeof(linger_opts);