Commit 1762685
packet: check
The `SSH_MSG_EXT_INFO` handler discards the return values from
`_libssh2_get_string()` when parsing extension name/value pairs. When
the buffer is exhausted before all claimed extensions are parsed,
the loop continues with no-op iterations until `nr_extensions` reaches
zero.
The `nr_extensions >= 1024` cap limits the worst case, but the loop
should still break on parse failure for correctness and consistency
with other parsers in this file (e.g. `SSH_MSG_CHANNEL_OPEN`,
`SSH_MSG_KEXINIT`) that check `_libssh2_get_string()` return values.
Closes #1864_libssh2_get_string() return in EXT_INFO handler1 parent 5a54b7c commit 1762685
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
890 | 890 | | |
891 | 891 | | |
892 | 892 | | |
893 | | - | |
894 | | - | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
895 | 897 | | |
896 | 898 | | |
897 | 899 | | |
| |||
0 commit comments