LedgerHQ / nanos-secure-sdk

Secure (ST31) SDK for Ledger Nano S
Apache License 2.0
96 stars 54 forks source link

Fix clang analyzer error #51

Closed askibin closed 1 year ago

askibin commented 1 year ago

PR https://github.com/LedgerHQ/app-solana/actions/runs/3183283776/jobs/5201485431 fails with:

/opt/nanos-secure-sdk/include/os_utils.h:26:11: warning: Array access (from variable 'buf') results in a null pointer dereference [core.NullDereference]
  return (buf[off] << 8) | buf[off + 1];
          ^~~~~~~~
xchapron-ledger commented 1 year ago

I don't think that this should be merged as is. If your analyzer think there is a possibility that your buffer is NULL, you should change your app code, not the SDK.