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:
@@ -1165,9 +1165,7 @@ Inode::Inode(Volume* volume, Inode* parent, const char* name, uint64 start,
|
|||||||
:
|
:
|
||||||
fNext(NULL)
|
fNext(NULL)
|
||||||
{
|
{
|
||||||
fName = strdup(name);
|
memset(&fWAVHeader, 0, sizeof(wav_header));
|
||||||
if (fName == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
fID = volume->GetNextNodeID();
|
fID = volume->GetNextNodeID();
|
||||||
fType = type;
|
fType = type;
|
||||||
@@ -1179,6 +1177,10 @@ Inode::Inode(Volume* volume, Inode* parent, const char* name, uint64 start,
|
|||||||
|
|
||||||
fCreationTime = fModificationTime = time(NULL);
|
fCreationTime = fModificationTime = time(NULL);
|
||||||
|
|
||||||
|
fName = strdup(name);
|
||||||
|
if (fName == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
if (frames) {
|
if (frames) {
|
||||||
// initialize WAV header
|
// initialize WAV header
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user