You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your report. Divising by zero is not a thing for floating-point computations, as in the worst case you'll get Inf which means you fed some garbage to the func. As for the second part of the issue - if calloc() failed then you're out of memory and even if you catch that error, the program will crash soon anyways as the graceful shutdown hasn't been implemented in CMUSphinx in general. You're, however, are welcome to make a patch.
Dear authors,
It seems that there exists potential division by zero error in
vector_quantize
function in src/programs/cdcn_train/vq.c in line 284.sphinxtrain/src/programs/cdcn_train/vq.c
Lines 280 to 284 in 811dfbf
When an arbitrary input comes from
sphinxtrain/src/programs/cdcn_train/main.c
Line 97 in 811dfbf
Distortion_and_cluster
function can return 0sphinxtrain/src/programs/cdcn_train/vq.c
Lines 171 to 187 in 811dfbf
sphinxtrain/src/programs/cdcn_train/vq.c
Lines 81 to 89 in 811dfbf
The scenarios could be when input is homogeneous or when the number of codewords matches unique vectors.
A simple possible patch would be
Also, there exists a potential memory allocation error causing the program to crash
at function
areadfloat_part
in sphinxtrain/src/libs/libio/s3io.cWhen an arbitrary value
r_len
is given as an argument withsizeof(float)
to calloc, it can return NULLsphinxtrain/src/libs/libio/s3io.c
Line 600 in 811dfbf
When an arbitrary value for
cur_ctl_sf
comes fromsphinxtrain/src/libs/libsphinxbase/util/pio.c
Line 331 in 811dfbf
sphinxtrain/src/libs/libio/corpus.c
Lines 320 to 328 in 811dfbf
sphinxtrain/src/libs/libio/corpus.c
Line 1080 in 811dfbf
The following trace can cause the program to crash
sphinxtrain/src/libs/libio/corpus.c
Lines 1319 to 1322 in 811dfbf
sphinxtrain/src/libs/libio/s3io.c
Line 590 in 811dfbf
sphinxtrain/src/libs/libio/s3io.c
Line 600 in 811dfbf
sphinxtrain/src/libs/libio/s3io.c
Line 601 in 811dfbf
A simple possible patch would be
These error was discovered by static analysis results
The text was updated successfully, but these errors were encountered: