Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenFileGDB: be robust to unusual .gdbindexes files with weird/corrupted/not-understood entries #11372

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented Nov 27, 2024

Fixes #11295

@rouault rouault added the backport release/3.10 Backport to release/3.10 branch label Nov 27, 2024
@rouault rouault changed the title OpenFileGDB: be robust to unusual .gdbindexes files with weid/corrupted/not-understood entries OpenFileGDB: be robust to unusual .gdbindexes files with weird/corrupted/not-understood entries Nov 27, 2024
@rouault rouault added the funded through GSP Work funded through the GDAL Sponsorship Program label Nov 27, 2024
@rouault rouault merged commit 8aa45ea into OSGeo:master Dec 2, 2024
39 checks passed
@@ -2547,7 +2548,7 @@ int FileGDBTable::GetIndexCount()
returnErrorAndCleanupIf(static_cast<GUInt32>(pabyEnd - pabyCur) <
sizeof(GUInt32),
VSIFree(pabyIdx));
GUInt32 nIdxNameCarCount = GetUInt32(pabyCur, 0);
const GUInt32 nIdxNameCarCount = GetUInt32(pabyCur, 0);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was Car actually meant to be Char ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in #11410

@@ -2557,13 +2558,56 @@ int FileGDBTable::GetIndexCount()
ReadUTF16String(pabyCur, nIdxNameCarCount));
pabyCur += 2 * nIdxNameCarCount;

// 4 "magic fields"
returnErrorAndCleanupIf(static_cast<GUInt32>(pabyEnd - pabyCur) <
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not follow: if the comparison is between a sum of size_t (that I assume to be size_t itself) why cast to GUInt32 ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in #11410

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport release/3.10 Backport to release/3.10 branch funded through GSP Work funded through the GDAL Sponsorship Program
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SetAttributeFilter / ApplicationException
2 participants