Skip to content

iscsi-scst: Fix wrong variable in chap_calc_digest_af_alg memcpy#342

Merged
lnocturno merged 1 commit intomasterfrom
3.11/gleb/fix
Jan 23, 2026
Merged

iscsi-scst: Fix wrong variable in chap_calc_digest_af_alg memcpy#342
lnocturno merged 1 commit intomasterfrom
3.11/gleb/fix

Conversation

@lnocturno
Copy link
Contributor

Use 'bytes' (the return value from af_alg_final) instead of 'res' (which is 0 after the last successful af_alg_update call) when copying the digest.

This bug caused the memcpy to copy 0 bytes, resulting in an uninitialized digest buffer. It also triggered a GCC -Werror=stringop-overflow warning because 'res' could theoretically be negative, leading to a huge unsigned size.

Use 'bytes' (the return value from af_alg_final) instead of 'res'
(which is 0 after the last successful af_alg_update call) when
copying the digest.

This bug caused the memcpy to copy 0 bytes, resulting in an
uninitialized digest buffer. It also triggered a GCC
-Werror=stringop-overflow warning because 'res' could theoretically
be negative, leading to a huge unsigned size.
@lnocturno lnocturno merged commit 6c6e725 into master Jan 23, 2026
52 checks passed
@lnocturno lnocturno deleted the 3.11/gleb/fix branch January 23, 2026 09:43
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