Skip to content

Fix expected failing value for WFSEEK() - #1145

Open
rlm2002 wants to merge 2 commits into
wolfSSL:masterfrom
rlm2002:sf14-WfSeek
Open

Fix expected failing value for WFSEEK()#1145
rlm2002 wants to merge 2 commits into
wolfSSL:masterfrom
rlm2002:sf14-WfSeek

Conversation

@rlm2002

@rlm2002 rlm2002 commented Aug 5, 2026

Copy link
Copy Markdown

Adds on to #1139. Adds WFSEEK_SUCCESS() to wolfssh/port.h, fixes issue where checking the return value of WFSEEK() against 0 may fail erroneously due to Nucleus (NU_Seek()) and MPLAB Harmony (SYS_FS_FileSeek()) returning the new file position and only signaling failure with a negative value.

Switches four call sites that test the WFSEEK() result:

  • src/ssh.c: wolfSSH_ReadKey_file()
  • src/wolfsftp.c: resume seek in wolfSSH_SFTP_Put()
  • apps/wolfssh/common.c, examples/client/common.c: load_der_file()

@rlm2002 rlm2002 self-assigned this Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant