-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Conversation
…ed/not-understood entries Fixes OSGeo#11295
@@ -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); |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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) < |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed in #11410
as suggested by @elpaso in OSGeo#11372 (review)
Fixes #11295