]> git.ipfire.org Git - thirdparty/libvirt.git/commit
rpc: libssh2: Fix regression in ssh host key verification
authorPeter Krempa <pkrempa@redhat.com>
Fri, 2 Oct 2015 13:49:01 +0000 (15:49 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 5 Oct 2015 05:38:18 +0000 (07:38 +0200)
commit9869f24d08af1f0d5f45175117953704064556c2
treed0e34388b3e800e5e238c38dc658ee9c967c7fad
parent387c316e11c0adcf7f8ed400019e044b47edf0f9
rpc: libssh2: Fix regression in ssh host key verification

Commit 792f81a40e caused a regression in the libssh2 host key
verification code by changing the variable type of 'i' to unsigned.
Since one of the loops used -1 as a special value if the asking
callback was found the conversion made a subsequent test always fail.

The bug was stealth enough to pass review, compilers and coverity.

Refactor the condition to avoid problems.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1047861
src/rpc/virnetsshsession.c