cdda: CID 610847: possibly uninitialized fields
In two cases: * Out of memory and strdup on fName failed. Nothing would be initialized (mostly harmless: InitCheck would detect this) * There are no frames in the track: the wav header would be left uninitialized, and this would be readable from userland (bad thing, but needs a specifically crafted malicious CD to happen).
This commit is contained in:
parent
7b4084f717
commit
735ca4068d
@ -1165,9 +1165,7 @@ Inode::Inode(Volume* volume, Inode* parent, const char* name, uint64 start,
|
||||
:
|
||||
fNext(NULL)
|
||||
{
|
||||
fName = strdup(name);
|
||||
if (fName == NULL)
|
||||
return;
|
||||
memset(&fWAVHeader, 0, sizeof(wav_header));
|
||||
|
||||
fID = volume->GetNextNodeID();
|
||||
fType = type;
|
||||
@ -1179,6 +1177,10 @@ Inode::Inode(Volume* volume, Inode* parent, const char* name, uint64 start,
|
||||
|
||||
fCreationTime = fModificationTime = time(NULL);
|
||||
|
||||
fName = strdup(name);
|
||||
if (fName == NULL)
|
||||
return;
|
||||
|
||||
if (frames) {
|
||||
// initialize WAV header
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user