Skip to content

Commit

Permalink
libsepol: expand: check for memory allocation failure
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
  • Loading branch information
cgzones authored and jwcart2 committed Aug 7, 2023
1 parent ace9ec1 commit 1c19dc4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libsepol/src/expand.c
Original file line number Diff line number Diff line change
Expand Up @@ -2993,6 +2993,10 @@ int expand_module(sepol_handle_t * handle,
state.out->policyvers = POLICYDB_VERSION_MAX;
if (state.base->name) {
state.out->name = strdup(state.base->name);
if (!state.out->name) {
ERR(handle, "Out of memory!");
goto cleanup;
}
}

/* Copy mls state from base to out */
Expand Down

0 comments on commit 1c19dc4

Please sign in to comment.