ReaderImplBase::ParseStrings(): Avoid new[0]
This commit is contained in:
@@ -569,7 +569,12 @@ ReaderImplBase::CheckCompression(const SectionInfo& section) const
|
|||||||
status_t
|
status_t
|
||||||
ReaderImplBase::ParseStrings()
|
ReaderImplBase::ParseStrings()
|
||||||
{
|
{
|
||||||
// allocate table
|
// allocate table, if there are any strings
|
||||||
|
if (fCurrentSection->stringsCount == 0) {
|
||||||
|
fCurrentSection->currentOffset += fCurrentSection->stringsLength;
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
fCurrentSection->strings
|
fCurrentSection->strings
|
||||||
= new(std::nothrow) char*[fCurrentSection->stringsCount];
|
= new(std::nothrow) char*[fCurrentSection->stringsCount];
|
||||||
if (fCurrentSection->strings == NULL) {
|
if (fCurrentSection->strings == NULL) {
|
||||||
|
|||||||
Reference in New Issue
Block a user