Skip to content

Commit

Permalink
Merge pull request #2991 from cesanta/unpacked_crash
Browse files Browse the repository at this point in the history
Fix mg_unpacked() crash
  • Loading branch information
cpq authored Dec 18, 2024
2 parents 1e1efa2 + 00c8f8a commit 7b296fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mongoose.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,8 @@ struct packed_file {
#if MG_ENABLE_PACKED_FS
#else
const char *mg_unpack(const char *path, size_t *size, time_t *mtime) {
*size = 0, *mtime = 0;
if (size != NULL) *size = 0;
if (mtime != NULL) *mtime = 0;
(void) path;
return NULL;
}
Expand Down
3 changes: 2 additions & 1 deletion src/fs_packed.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ struct packed_file {
#if MG_ENABLE_PACKED_FS
#else
const char *mg_unpack(const char *path, size_t *size, time_t *mtime) {
*size = 0, *mtime = 0;
if (size != NULL) *size = 0;
if (mtime != NULL) *mtime = 0;
(void) path;
return NULL;
}
Expand Down

0 comments on commit 7b296fa

Please sign in to comment.