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

[pull] master from OSGeo:master #98

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frmts/hdf4/hdf-eos/EHapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,7 +1484,7 @@ EHmetagroup(int32 sdInterfaceID, const char *structname, const char *structcode,
int32 metalen; /* Length of structural metadata */

char *metabuf; /* Pointer (handle) to structural metadata */
char *endptr; /* Pointer to end of metadata section */
char *endptr = NULL; /* Pointer to end of metadata section */
char *metaptr; /* Metadata pointer */
char *prevmetaptr;/* Previous position of metadata pointer */
char *utlstr; /* Utility string */
Expand Down Expand Up @@ -1605,7 +1605,7 @@ EHmetagroup(int32 sdInterfaceID, const char *structname, const char *structcode,
}
/* Find group within structure */
/* --------------------------- */
if (groupname != NULL)
if (metaptr && groupname != NULL)
{
snprintf(utlstr, UTLSTR_MAX_SIZE, "%s%s", "GROUP=", groupname);
metaptr = strstr(metaptr, utlstr);
Expand All @@ -1615,7 +1615,7 @@ EHmetagroup(int32 sdInterfaceID, const char *structname, const char *structcode,
endptr = strstr(metaptr, utlstr);
else
endptr = NULL;
} else
} else if (metaptr)
{
/* If groupname == NULL then find end of structure in metadata */
/* ----------------------------------------------------------- */
Expand Down