Skip to content

Commit

Permalink
avoid dereferencing prog which may be NULL
Browse files Browse the repository at this point in the history
CID 353002
  • Loading branch information
tonycoz committed Aug 8, 2022
1 parent 90eef0a commit c870f3e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion regcomp.c
Expand Up @@ -20906,7 +20906,7 @@ Perl_get_re_gclass_aux_data(pTHX_ const regexp *prog, const regnode* node, bool
SV *si = NULL; /* Input initialization string */
SV* invlist = NULL;

RXi_GET_DECL(prog, progi);
RXi_GET_DECL_NULL(prog, progi);
const struct reg_data * const data = prog ? progi->data : NULL;

#if !defined(PERL_IN_XSUB_RE) || defined(PLUGGABLE_RE_EXTENSION)
Expand Down
1 change: 1 addition & 0 deletions regcomp.h
Expand Up @@ -82,6 +82,7 @@ typedef struct regexp_internal {
#define RXi_SET(x,y) (x)->pprivate = (void*)(y)
#define RXi_GET(x) ((regexp_internal *)((x)->pprivate))
#define RXi_GET_DECL(r,ri) regexp_internal *ri = RXi_GET(r)
#define RXi_GET_DECL_NULL(r,ri) regexp_internal *ri = (r) ? RXi_GET(r) : NULL
/*
* Flags stored in regexp->intflags
* These are used only internally to the regexp engine
Expand Down

0 comments on commit c870f3e

Please sign in to comment.