Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit c9f3d90

Browse files
committed
Merge commit '0cceefd49d4d397eb21bd36e314ac87739da51ff'
2 parents 5ea4e86 + 0cceefd commit c9f3d90

69 files changed

Lines changed: 1929 additions & 427 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitlab-ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,9 +456,11 @@ tumbleweed/static-analysis:
456456
- obj/scan
457457

458458
visualstudio/x86_64:
459+
variables:
460+
ErrorActionPreference: STOP
459461
script:
460462
- $env:VCPKG_DEFAULT_TRIPLET="x64-windows"
461-
- cd obj
463+
- mkdir -p obj; if ($?) {cd obj}; if (! $?) {exit 1}
462464
- cmake
463465
-A x64
464466
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_TOOLCHAIN_FILE"
@@ -484,9 +486,11 @@ visualstudio/x86_64:
484486
- obj/
485487

486488
visualstudio/x86:
489+
variables:
490+
ErrorActionPreference: STOP
487491
script:
488492
- $env:VCPKG_DEFAULT_TRIPLET="x86-windows"
489-
- cd obj
493+
- mkdir -p obj; if ($?) {cd obj}; if (! $?) {exit 1}
490494
- cmake
491495
-DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_TOOLCHAIN_FILE"
492496
-DPICKY_DEVELOPER=ON

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
1010
include(DefineCMakeDefaults)
1111
include(DefineCompilerFlags)
1212

13-
project(libssh VERSION 0.9.3 LANGUAGES C)
13+
project(libssh VERSION 0.9.5 LANGUAGES C)
1414

1515
# global needed variable
1616
set(APPLICATION_NAME ${PROJECT_NAME})
@@ -22,7 +22,7 @@ set(APPLICATION_NAME ${PROJECT_NAME})
2222
# Increment AGE. Set REVISION to 0
2323
# If the source code was changed, but there were no interface changes:
2424
# Increment REVISION.
25-
set(LIBRARY_VERSION "4.8.4")
25+
set(LIBRARY_VERSION "4.8.6")
2626
set(LIBRARY_SOVERSION "4")
2727

2828
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked

ChangeLog

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
ChangeLog
22
==========
33

4+
version 0.9.5 (released 2020-XX-XX)
5+
* CVE-2020-16135: Avoid null pointer dereference in sftpserver (T232)
6+
* Improve handling of library initialization (T222)
7+
* Fix parsing of subsecond times in SFTP (T219)
8+
* Make the documentation reproducible
9+
* Remove deprecated API usage in OpenSSL
10+
* Fix regression of ssh_channel_poll_timeout() returning SSH_AGAIN
11+
* Define version in one place (T226)
12+
* Prevent invalid free when using different C runtimes than OpenSSL (T229)
13+
* Compatibility improvements to testsuite
14+
15+
version 0.9.4 (released 2020-04-09)
16+
* Fixed CVE-2020-1730 - Possible DoS in client and server when handling
17+
AES-CTR keys with OpenSSL
18+
* Added diffie-hellman-group14-sha256
19+
* Fixed serveral possible memory leaks
20+
421
version 0.9.3 (released 2019-12-10)
522
* Fixed CVE-2019-14889 - SCP: Unsanitized location leads to command execution
623
* SSH-01-003 Client: Missing NULL check leads to crash in erroneous state

doc/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ if (DOXYGEN_FOUND)
1313
set(DOXYGEN_TAB_SIZE 4)
1414
set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C YES)
1515
set(DOXYGEN_MARKDOWN_SUPPORT YES)
16+
set(DOXYGEN_FULL_PATH_NAMES NO)
1617

1718
set(DOXYGEN_PREDEFINED DOXYGEN
19+
WITH_SERVER
20+
WITH_SFTP
1821
PRINTF_ATTRIBUTE(x,y))
1922

2023
set(DOXYGEN_EXCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/that_style)

doc/linking.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ the dllimport attribute.
2828
@endcode
2929

3030
If you're are statically linking with OpenSSL, read the "Linking your
31-
application" section in the NOTES.<OS> in the OpenSSL source tree!
31+
application" section in the NOTES.[OS] in the OpenSSL source tree!
3232

3333
*/

examples/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set(examples_SRCS
66
connect_ssh.c
77
)
88

9-
include_directories(${libssh_BINARY_DIR})
9+
include_directories(${libssh_BINARY_DIR}/include ${libssh_BINARY_DIR})
1010

1111
if (ARGP_INCLUDE_DIR)
1212
include_directories(${ARGP_INCLUDE_DIR})

examples/exec.c

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ int main(void) {
88
ssh_session session;
99
ssh_channel channel;
1010
char buffer[256];
11-
int nbytes;
11+
int rbytes, wbytes, total = 0;
1212
int rc;
1313

1414
session = connect_ssh("localhost", NULL, 0);
@@ -35,15 +35,30 @@ int main(void) {
3535
goto failed;
3636
}
3737

38-
nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
39-
while (nbytes > 0) {
40-
if (fwrite(buffer, 1, nbytes, stdout) != (unsigned int) nbytes) {
38+
rbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
39+
if (rbytes <= 0) {
40+
goto failed;
41+
}
42+
43+
do {
44+
wbytes = fwrite(buffer + total, 1, rbytes, stdout);
45+
if (wbytes <= 0) {
4146
goto failed;
4247
}
43-
nbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
44-
}
4548

46-
if (nbytes < 0) {
49+
total += wbytes;
50+
51+
/* When it was not possible to write the whole buffer to stdout */
52+
if (wbytes < rbytes) {
53+
rbytes -= wbytes;
54+
continue;
55+
}
56+
57+
rbytes = ssh_channel_read(channel, buffer, sizeof(buffer), 0);
58+
total = 0;
59+
} while (rbytes > 0);
60+
61+
if (rbytes < 0) {
4762
goto failed;
4863
}
4964

0 commit comments

Comments
 (0)