Later on, num_nnz is utilized as total_lines in the _sort_and_compressed_binarization() function.
The values stored in the path file are pass to the records vector, and this vector is read based on the total_lines. code
If the calculation of num_nnz is inflated due to the newline, it exceeds the index of the records vector, leading to references outside the bounds.
Consequently, reading unexpected values triggers a segment fault or program malfunction.
Changes
In instances where an empty line is inputted, it has been modified to be disregarded using the continue statement. Additionally, a typo identified during debugging has been rectified.
While using the W2V model, a vulnerability arises, resulting in a memory error if the input stream data contains empty lines without characters.
Cause During the reading of stream data, if a line contains only a newline character, the
num_nnz
variable is incremented by 1. codeLater on,
num_nnz
is utilized astotal_lines
in the _sort_and_compressed_binarization() function. The values stored in thepath
file are pass to therecords
vector, and this vector is read based on thetotal_lines
. code If the calculation ofnum_nnz
is inflated due to the newline, it exceeds the index of therecords
vector, leading to references outside the bounds. Consequently, reading unexpected values triggers a segment fault or program malfunction.Changes In instances where an empty line is inputted, it has been modified to be disregarded using the
continue
statement. Additionally, a typo identified during debugging has been rectified.