Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package socket_wrapper for openSUSE:Factory 
checked in at 2022-07-31 23:00:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/socket_wrapper (Old)
 and      /work/SRC/openSUSE:Factory/.socket_wrapper.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "socket_wrapper"

Sun Jul 31 23:00:39 2022 rev:18 rq:991556 version:1.3.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/socket_wrapper/socket_wrapper.changes    
2021-03-19 16:40:19.125884246 +0100
+++ /work/SRC/openSUSE:Factory/.socket_wrapper.new.1533/socket_wrapper.changes  
2022-07-31 23:00:54.507685552 +0200
@@ -1,0 +2,7 @@
+Thu Jul 21 12:53:16 UTC 2022 - Andreas Schneider <[email protected]>
+
+- Update to version 1.3.4
+  * Fixed TOCTOU issue with udp auto binding
+  * Fixed running on FreeBSD
+
+-------------------------------------------------------------------

Old:
----
  socket_wrapper-1.3.3.tar.gz
  socket_wrapper-1.3.3.tar.gz.asc

New:
----
  socket_wrapper-1.3.4.tar.gz
  socket_wrapper-1.3.4.tar.gz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ socket_wrapper.spec ++++++
--- /var/tmp/diff_new_pack.2iLXcs/_old  2022-07-31 23:00:54.943686819 +0200
+++ /var/tmp/diff_new_pack.2iLXcs/_new  2022-07-31 23:00:54.947686830 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package socket_wrapper
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
 ############################# NOTE ##################################
 
 Name:           socket_wrapper
-Version:        1.3.3
+Version:        1.3.4
 Release:        0
 Summary:        A library passing all socket communications through Unix 
sockets
 License:        BSD-3-Clause

++++++ socket_wrapper-1.3.3.tar.gz -> socket_wrapper-1.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/socket_wrapper-1.3.3/.editorconfig 
new/socket_wrapper-1.3.4/.editorconfig
--- old/socket_wrapper-1.3.3/.editorconfig      1970-01-01 01:00:00.000000000 
+0100
+++ new/socket_wrapper-1.3.4/.editorconfig      2022-07-21 14:50:10.000000000 
+0200
@@ -0,0 +1,23 @@
+root = true
+
+[*]
+charset = utf-8
+max_line_length = 80
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.{c,h}]
+indent_style = tab
+indent_size = 8
+tab_width = 8
+
+[*.cmake]
+indent_style = space
+indent_size = 4
+tab_width = 4
+
+[CMake*]
+indent_style = space
+indent_size = 4
+tab_width = 4
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/socket_wrapper-1.3.3/.gitlab-ci.yml 
new/socket_wrapper-1.3.4/.gitlab-ci.yml
--- old/socket_wrapper-1.3.3/.gitlab-ci.yml     2021-02-05 14:11:25.000000000 
+0100
+++ new/socket_wrapper-1.3.4/.gitlab-ci.yml     2022-07-21 14:50:10.000000000 
+0200
@@ -1,3 +1,4 @@
+---
 variables:
   BUILD_IMAGES_PROJECT: cmocka/gitlab-build-images
   FEDORA_BUILD: buildenv-fedora
@@ -6,18 +7,24 @@
   MINGW_BUILD: buildenv-mingw
   UBUNTU_BUILD: buildenv-ubuntu
 
+stages:
+  - build
+  - test
+  - analysis
+
 centos7/x86_64:
+  stage: test
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$CENTOS7_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake3
-    -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake3
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -25,17 +32,18 @@
       - obj/
 
 fedora/x86_64:
+  stage: test
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -43,17 +51,18 @@
       - obj/
 
 fedora/address-sanitizer:
+  stage: build
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=AddressSanitizer
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=AddressSanitizer
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -61,16 +70,17 @@
       - obj/
 
 fedora/undefined-sanitizer:
+  stage: analysis
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=UndefinedSanitizer
-    -DUNIT_TESTING=ON ..
-    && make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=UndefinedSanitizer
+      -DUNIT_TESTING=ON ..
+      && make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -81,17 +91,18 @@
 #
 # fedora/thread-sanitizer:
 tumbleweed/thread-sanitizer:
+  stage: analysis
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=ThreadSanitizer
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=ThreadSanitizer
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -99,30 +110,32 @@
       - obj/
 
 fedora/csbuild:
+  stage: analysis
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
   script:
-  - |
-    if [[ -z "$CI_COMMIT_BEFORE_SHA" ]]; then
+    - |
+      if [[ -z "$CI_COMMIT_BEFORE_SHA" ]]; then
+          export CI_COMMIT_BEFORE_SHA=$(git rev-parse "${CI_COMMIT_SHA}~20")
+      fi
+
+      # Check if the commit exists in this branch
+      # This is not the case for a force push
+      git branch --contains $CI_COMMIT_BEFORE_SHA 2>/dev/null ||
         export CI_COMMIT_BEFORE_SHA=$(git rev-parse "${CI_COMMIT_SHA}~20")
-    fi
-
-    # Check if the commit exists in this branch
-    # This is not the case for a force push
-    git branch --contains $CI_COMMIT_BEFORE_SHA 2>/dev/null || export 
CI_COMMIT_BEFORE_SHA=$(git rev-parse "${CI_COMMIT_SHA}~20")
 
-    export CI_COMMIT_RANGE="$CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"
+      export CI_COMMIT_RANGE="$CI_COMMIT_BEFORE_SHA..$CI_COMMIT_SHA"
 
-  - csbuild
-    --build-dir=obj-csbuild
-    --prep-cmd="cmake -DCMAKE_BUILD_TYPE=Debug -DPICKY_DEVELOPER=ON 
-DUNIT_TESTING=ON @SRCDIR@"
-    --build-cmd "make clean && make -j$(nproc)"
-    --git-commit-range $CI_COMMIT_RANGE
-    --color
-    --print-current --print-fixed
+    - csbuild
+      --build-dir=obj-csbuild
+      --prep-cmd="cmake -DCMAKE_BUILD_TYPE=Debug -DPICKY_DEVELOPER=ON 
-DUNIT_TESTING=ON @SRCDIR@"
+      --build-cmd "make clean && make -j$(nproc)"
+      --git-commit-range $CI_COMMIT_RANGE
+      --color
+      --print-current --print-fixed
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -130,21 +143,22 @@
       - obj-csbuild/
 
 freebsd/x86_64:
+  stage: test
   image:
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make && ctest --output-on-failure
   tags:
-  - freebsd
+    - freebsd
   except:
-  - tags
+    - tags
   only:
-  - branches@cwrap/socket_wrapper
-  - branches@cryptomilk/socket_wrapper
-  - branches@metze/socket_wrapper
+    - branches@cwrap/socket_wrapper
+    - branches@cryptomilk/socket_wrapper
+    - branches@metze/socket_wrapper
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -152,17 +166,18 @@
       - obj/
 
 tumbleweed/x86_64/gcc:
+  stage: test
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -170,18 +185,19 @@
       - obj/
 
 tumbleweed/x86_64/gcc7:
+  stage: test
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7
-    -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_C_COMPILER=gcc-7 -DCMAKE_CXX_COMPILER=g++-7
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -189,18 +205,19 @@
       - obj/
 
 tumbleweed/x86_64/clang:
+  stage: test
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -208,20 +225,21 @@
       - obj/
 
 tumbleweed/static-analysis:
+  stage: analysis
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
   script:
-  - export CCC_CC=clang
-  - export CCC_CXX=clang++
-  - mkdir -p obj && cd obj && scan-build cmake
-    -DCMAKE_BUILD_TYPE=Debug
-    -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    scan-build --status-bugs -o scan make -j$(nproc)
+    - export CCC_CC=clang
+    - export CCC_CXX=clang++
+    - mkdir -p obj && cd obj && scan-build cmake
+      -DCMAKE_BUILD_TYPE=Debug
+      -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      scan-build --status-bugs -o scan make -j$(nproc)
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -229,18 +247,19 @@
       - obj/scan
 
 tumbleweed/helgrind:
+  stage: analysis
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$TUMBLEWEED_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=Debug
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON
-    -DHELGRIND_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=Debug
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON
+      -DHELGRIND_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
@@ -251,17 +270,18 @@
       - $VALGRIND_SUPPORTS_FORKED_MUTEXES == "yes"
 
 ubuntu/x86_64:
+  stage: test
   image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$UBUNTU_BUILD
   script:
-  - mkdir -p obj && cd obj && cmake
-    -DCMAKE_BUILD_TYPE=RelWithDebInfo
-    -DPICKY_DEVELOPER=ON
-    -DUNIT_TESTING=ON .. &&
-    make -j$(nproc) && ctest --output-on-failure
+    - mkdir -p obj && cd obj && cmake
+      -DCMAKE_BUILD_TYPE=RelWithDebInfo
+      -DPICKY_DEVELOPER=ON
+      -DUNIT_TESTING=ON .. &&
+      make -j$(nproc) && ctest --output-on-failure
   tags:
-  - shared
+    - shared
   except:
-  - tags
+    - tags
   artifacts:
     expire_in: 1 week
     when: on_failure
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/socket_wrapper-1.3.3/CHANGELOG 
new/socket_wrapper-1.3.4/CHANGELOG
--- old/socket_wrapper-1.3.3/CHANGELOG  2021-03-17 09:53:45.000000000 +0100
+++ new/socket_wrapper-1.3.4/CHANGELOG  2022-07-21 14:50:10.000000000 +0200
@@ -1,6 +1,10 @@
 ChangeLog
 ==========
 
+version 1.3.4 (released 2022-07-21)
+  * Fixed TOCTOU issue with udp auto binding
+  * Fixed running on FreeBSD
+
 version 1.3.3 (released 2021-03-17)
   * Added public libsocket_wrapper_noop library
   * Added wrapper for wrap __close_nocancel()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/socket_wrapper-1.3.3/CMakeLists.txt 
new/socket_wrapper-1.3.4/CMakeLists.txt
--- old/socket_wrapper-1.3.3/CMakeLists.txt     2021-03-17 09:53:45.000000000 
+0100
+++ new/socket_wrapper-1.3.4/CMakeLists.txt     2022-07-21 14:50:10.000000000 
+0200
@@ -2,7 +2,7 @@
 cmake_minimum_required(VERSION 3.5.0)
 cmake_policy(SET CMP0048 NEW)
 
-# Specify search path for CMake modules to be loaded by include() 
+# Specify search path for CMake modules to be loaded by include()
 # and find_package()
 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
 
@@ -11,7 +11,7 @@
 include(DefineCMakeDefaults)
 include(DefineCompilerFlags)
 
-project(socket_wrapper VERSION 1.3.3 LANGUAGES C)
+project(socket_wrapper VERSION 1.3.4 LANGUAGES C)
 
 # global needed variables
 set(APPLICATION_NAME ${PROJECT_NAME})
@@ -25,7 +25,7 @@
 #     Increment PATCH.
 set(LIBRARY_VERSION_MAJOR 0)
 set(LIBRARY_VERSION_MINOR 3)
-set(LIBRARY_VERSION_PATCH 0)
+set(LIBRARY_VERSION_PATCH 1)
 set(LIBRARY_VERSION 
"${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}.${LIBRARY_VERSION_PATCH}")
 set(LIBRARY_SOVERSION ${LIBRARY_VERSION_MAJOR})
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/socket_wrapper-1.3.3/CompilerChecks.cmake 
new/socket_wrapper-1.3.4/CompilerChecks.cmake
--- old/socket_wrapper-1.3.3/CompilerChecks.cmake       2019-03-21 
13:50:53.000000000 +0100
+++ new/socket_wrapper-1.3.4/CompilerChecks.cmake       2022-07-21 
14:50:10.000000000 +0200
@@ -38,8 +38,11 @@
     add_c_compiler_flag("-Wuninitialized" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Werror=uninitialized" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wimplicit-fallthrough" SUPPORTED_COMPILER_FLAGS)
-    add_c_compiler_flag("-Werror=strict-overflow" SUPPORTED_COMPILER_FLAGS)
-    add_c_compiler_flag("-Wstrict-overflow=2" SUPPORTED_COMPILER_FLAGS)
+    # FIXME: We can't use this as there is a glibc bug in socket.h
+    # https://bugzilla.redhat.com/show_bug.cgi?id=2047022
+    # https://sourceware.org/bugzilla/show_bug.cgi?id=28846
+    #add_c_compiler_flag("-Werror=strict-overflow" SUPPORTED_COMPILER_FLAGS)
+    #add_c_compiler_flag("-Wstrict-overflow=2" SUPPORTED_COMPILER_FLAGS)
     add_c_compiler_flag("-Wno-format-zero-length" SUPPORTED_COMPILER_FLAGS)
 
     check_c_compiler_flag("-Wformat" REQUIRED_FLAGS_WFORMAT)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/socket_wrapper-1.3.3/src/socket_wrapper.c 
new/socket_wrapper-1.3.4/src/socket_wrapper.c
--- old/socket_wrapper-1.3.3/src/socket_wrapper.c       2021-03-17 
09:53:42.000000000 +0100
+++ new/socket_wrapper-1.3.4/src/socket_wrapper.c       2022-07-21 
14:50:10.000000000 +0200
@@ -3815,7 +3815,6 @@
        char type;
        int ret;
        int port;
-       struct stat st;
        char *swrap_dir = NULL;
 
        swrap_mutex_lock(&autobind_start_mutex);
@@ -3916,10 +3915,12 @@
                              type,
                              socket_wrapper_default_iface(),
                              port);
-               if (stat(un_addr.sa.un.sun_path, &st) == 0) continue;
 
                ret = libc_bind(fd, &un_addr.sa.s, un_addr.sa_socklen);
                if (ret == -1) {
+                       if (errno == EALREADY || errno == EADDRINUSE) {
+                               continue;
+                       }
                        goto done;
                }
 
@@ -6285,9 +6286,11 @@
 
        for (i = 0; i < (size_t)msg->msg_iovlen; i++) {
                size_t this_time = MIN(remain, (size_t)msg->msg_iov[i].iov_len);
-               memcpy(buf + ofs,
-                      msg->msg_iov[i].iov_base,
-                      this_time);
+               if (this_time > 0) {
+                       memcpy(buf + ofs,
+                              msg->msg_iov[i].iov_base,
+                              this_time);
+               }
                ofs += this_time;
                remain -= this_time;
        }
@@ -7849,8 +7852,8 @@
  * related syscalls also with the '_' prefix.
  *
  * This is tested in Samba's 'make test',
- * there we noticed that providing '_read'
- * and '_open' would cause errors, which
+ * there we noticed that providing '_read',
+ * '_open' and '_close' would cause errors, which
  * means we skip '_read', '_write' and
  * all non socket related calls without
  * further analyzing the problem.
@@ -7863,7 +7866,6 @@
 #endif
 SWRAP_SYMBOL_ALIAS(accept, _accept);
 SWRAP_SYMBOL_ALIAS(bind, _bind);
-SWRAP_SYMBOL_ALIAS(close, _close);
 SWRAP_SYMBOL_ALIAS(connect, _connect);
 SWRAP_SYMBOL_ALIAS(dup, _dup);
 SWRAP_SYMBOL_ALIAS(dup2, _dup2);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/socket_wrapper-1.3.3/tests/test_echo_tcp_sendmsg_recvmsg_fd.c 
new/socket_wrapper-1.3.4/tests/test_echo_tcp_sendmsg_recvmsg_fd.c
--- old/socket_wrapper-1.3.3/tests/test_echo_tcp_sendmsg_recvmsg_fd.c   
2021-02-09 16:53:36.000000000 +0100
+++ new/socket_wrapper-1.3.4/tests/test_echo_tcp_sendmsg_recvmsg_fd.c   
2022-07-21 14:50:10.000000000 +0200
@@ -320,6 +320,9 @@
        int fd_array[num_fds];
        size_t idx;
 
+       assert_int_not_equal(num_fds, 0);
+       memset(fd_array, -1, sizeof(fd_array));
+
        for (idx = 0; idx < num_fds; idx++) {
                struct torture_address addr = {
                        .sa_socklen = sizeof(struct sockaddr_in),
@@ -388,10 +391,10 @@
        int close_array[num_fds];
        size_t idx;
 
-       for (idx = 0; idx < num_fds; idx++) {
-               fd_array[idx] = -1;
-               close_array[idx] = -1;
-       }
+       assert_int_not_equal(num_fds, 0);
+
+       memset(fd_array, -1, sizeof(fd_array));
+       memset(close_array, -1, sizeof(fd_array));
 
        /*
         * We send

Reply via email to