mirror of
https://github.com/rhasspy/espeak-ng.git
synced 2026-10-31 05:35:35 +00:00
Fix a null pointer dereference in LoadSpectSeq(spect.c). [Coverity]
This commit is contained in:
@@ -304,7 +304,10 @@ espeak_ng_STATUS LoadSpectSeq(SpectSeq *spect, const char *filename)
|
||||
|
||||
fread(&name_len, sizeof(uint32_t), 1, stream);
|
||||
if (name_len > 0) {
|
||||
spect->name = (char *)malloc(name_len);
|
||||
if ((spect->name = (char *)malloc(name_len)) == NULL) {
|
||||
fclose(stream);
|
||||
return ENOMEM;
|
||||
}
|
||||
fread(spect->name, sizeof(char), name_len, stream);
|
||||
} else
|
||||
spect->name = NULL;
|
||||
|
||||
Reference in New Issue
Block a user