]> xenbits.xensource.com Git - libvirt.git/commit
virTestCompareToFile: Don't access memory we don't own
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 4 Aug 2017 13:22:53 +0000 (15:22 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 7 Aug 2017 08:44:06 +0000 (10:44 +0200)
commit3506f1ecfde2dd9af54d0cb0971af4792e7d3601
treed4ea33eeeb382d8dfff0f23c44c937afd2f1158b
parente0a4eaa913a5aa70f36501a33ccc5aceb61bc7fa
virTestCompareToFile: Don't access memory we don't own

After reading the contents of a file some cleanup is performed.
However, the check for it might access a byte outside of the
string - if the file is empty in the first place. Then strlen()
is zero.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
tests/testutils.c