From 6d51cc8278cd3f81d541ad2ec03da99becb5c87a Mon Sep 17 00:00:00 2001 From: John Safranek Date: Fri, 22 Mar 2024 17:09:01 -0700 Subject: [PATCH] Release v1.4.17: Release Testing Fixes 1. C++ build required some additional typecasting. 2. C++ complained about using the `= { 0 }` initializer, switched to `WMEMSET()`. --- apps/wolfssh/common.c | 3 ++- apps/wolfssh/wolfssh.c | 2 +- apps/wolfsshd/wolfsshd.c | 3 ++- examples/client/common.c | 3 ++- src/wolfsftp.c | 6 ++++-- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/wolfssh/common.c b/apps/wolfssh/common.c index 90650813c..5d5a90d33 100644 --- a/apps/wolfssh/common.c +++ b/apps/wolfssh/common.c @@ -451,7 +451,8 @@ int ClientPublicKeyCheck(const byte* pubKey, word32 pubKeySz, void* ctx) current->ipString); WLOG(WS_LOG_DEBUG, "\texpecting host IP : %s", (char*)ctx); - if (XSTRCMP(ctx, current->ipString) == 0) { + if (XSTRCMP((const char*)ctx, + current->ipString) == 0) { WLOG(WS_LOG_DEBUG, "\tmatched!"); ipMatch = 1; } diff --git a/apps/wolfssh/wolfssh.c b/apps/wolfssh/wolfssh.c index c1ce13a49..73a3cbbaa 100644 --- a/apps/wolfssh/wolfssh.c +++ b/apps/wolfssh/wolfssh.c @@ -794,7 +794,7 @@ static int config_parse_command_line(struct config* config, free(config->user); } sz = WSTRLEN(cursor); - config->user = WMALLOC(sz + 1, NULL, 0); + config->user = (char*)WMALLOC(sz + 1, NULL, 0); strcpy(config->user, cursor); cursor = found + 1; } diff --git a/apps/wolfsshd/wolfsshd.c b/apps/wolfsshd/wolfsshd.c index 9f95336b4..ccaafd175 100644 --- a/apps/wolfsshd/wolfsshd.c +++ b/apps/wolfsshd/wolfsshd.c @@ -1391,8 +1391,9 @@ static int SHELL_Subsystem(WOLFSSHD_CONNECTION* conn, WOLFSSH* ssh, #if defined(HAVE_SYS_IOCTL_H) wolfSSH_DoModes(ssh->modes, ssh->modesSz, childFd); { - struct winsize s = {0}; + struct winsize s; + WMEMSET(&s, 0, sizeof(s)); s.ws_col = ssh->widthChar; s.ws_row = ssh->heightRows; s.ws_xpixel = ssh->widthPixels; diff --git a/examples/client/common.c b/examples/client/common.c index 0b3ead698..302dea58f 100644 --- a/examples/client/common.c +++ b/examples/client/common.c @@ -403,7 +403,8 @@ int ClientPublicKeyCheck(const byte* pubKey, word32 pubKeySz, void* ctx) current->ipString); WLOG(WS_LOG_DEBUG, "\texpecting host IP : %s", (char*)ctx); - if (XSTRCMP(ctx, current->ipString) == 0) { + if (XSTRCMP((const char*)ctx, + current->ipString) == 0) { WLOG(WS_LOG_DEBUG, "\tmatched!"); ipMatch = 1; } diff --git a/src/wolfsftp.c b/src/wolfsftp.c index 7320c0fd7..0a90f10f6 100644 --- a/src/wolfsftp.c +++ b/src/wolfsftp.c @@ -2042,7 +2042,8 @@ int wolfSSH_SFTP_RecvOpen(WOLFSSH* ssh, int reqId, byte* data, word32 maxSz) } { - WS_SFTP_FILEATRB fileAtr = { 0 }; + WS_SFTP_FILEATRB fileAtr; + WMEMSET(&fileAtr, 0, sizeof(fileAtr)); if (SFTP_GetAttributes(ssh->fs, dir, &fileAtr, 1, ssh->ctx->heap) == WS_SUCCESS) { if ((fileAtr.per & FILEATRB_PER_MASK_TYPE) != FILEATRB_PER_FILE) { @@ -8767,7 +8768,8 @@ int wolfSSH_SFTP_Put(WOLFSSH* ssh, char* from, char* to, byte resume, WLOG(WS_LOG_SFTP, "SFTP PUT STATE: OPEN LOCAL"); #ifndef USE_WINDOWS_API { - WS_SFTP_FILEATRB fileAtr = { 0 }; + WS_SFTP_FILEATRB fileAtr; + WMEMSET(&fileAtr, 0, sizeof(fileAtr)); if (SFTP_GetAttributes(ssh->fs, from, &fileAtr, 1, ssh->ctx->heap) == WS_SUCCESS) {