Projects
openEuler:Mainline
libssh2
_service:tar_scm:backport-misc-libssh2_copy_str...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-misc-libssh2_copy_string-avoid-malloc-zero-bytes.patch of Package libssh2
From: https://github.com/libssh2/libssh2/commit/e7e1312b0cbfa643e2f8bf5f2036ce5147ed797d From: bagder <daniel@haxx.se> Date: 21 Mar 2022 10:11 -0800 Subject: misc/libssh2_copy_string: avoid malloc zero bytes #686 Notes: * Avoid the inconsistent malloc return code for malloc(0) --- libssh2-1.10.0/src/misc.c 2019-09-13 14:39:11.000000000 +0800 +++ libssh2-1.10.0/src/misc.c 2022-09-29 18:27:13.604424483 +0800 @@ -794,12 +794,18 @@ return -1; } - *outbuf = LIBSSH2_ALLOC(session, str_len); - if(*outbuf) { - memcpy(*outbuf, str, str_len); + if(str_len) { + *outbuf = LIBSSH2_ALLOC(session, str_len); + if(*outbuf) { + memcpy(*outbuf, str, str_len); + } + else { + return -1; + } } else { - return -1; + *outlen = 0; + *outbuf = NULL; } if(outlen)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2