Mageia Bugzilla – Attachment 4965 Details for
Bug 12665
pcre is bundled with mariadb-10.x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
The stack guard patch
pcre-8.34-stack_guard.diff (text/plain), 3.44 KB, created by
Oden Eriksson
on 2014-02-08 17:08:08 CET
(
hide
)
Description:
The stack guard patch
Filename:
MIME Type:
Creator:
Oden Eriksson
Created:
2014-02-08 17:08:08 CET
Size:
3.44 KB
patch
obsolete
>diff -Naurp pcre-8.34/pcre_compile.c pcre-8.34.oden/pcre_compile.c >--- pcre-8.34/pcre_compile.c 2013-12-15 17:56:22.000000000 +0100 >+++ pcre-8.34.oden/pcre_compile.c 2014-02-07 19:43:10.759051139 +0100 >@@ -7994,6 +7994,12 @@ unsigned int orig_bracount; > unsigned int max_bracount; > branch_chain bc; > >+if (PUBL(stack_guard) && PUBL(stack_guard)()) >+{ >+ *errorcodeptr= ERR23; >+ return FALSE; >+} >+ > bc.outer = bcptr; > bc.current_branch = code; > >diff -Naurp pcre-8.34/pcre_globals.c pcre-8.34.oden/pcre_globals.c >--- pcre-8.34/pcre_globals.c 2012-01-05 18:07:07.000000000 +0100 >+++ pcre-8.34.oden/pcre_globals.c 2014-02-07 19:43:10.760051139 +0100 >@@ -72,6 +72,7 @@ PCRE_EXP_DATA_DEFN void (*PUBL(free))(v > PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = LocalPcreMalloc; > PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = LocalPcreFree; > PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL; >+PCRE_EXP_DATA_DEFN int (*PUBL(stack_guard))(void) = NULL; > > #elif !defined VPCOMPAT > PCRE_EXP_DATA_DEFN void *(*PUBL(malloc))(size_t) = malloc; >@@ -79,6 +80,7 @@ PCRE_EXP_DATA_DEFN void (*PUBL(free))(v > PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = malloc; > PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = free; > PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL; >+PCRE_EXP_DATA_DEFN int (*PUBL(stack_guard))(void) = NULL; > #endif > > /* End of pcre_globals.c */ >diff -Naurp pcre-8.34/pcre.h.in pcre-8.34.oden/pcre.h.in >--- pcre-8.34/pcre.h.in 2013-11-12 16:09:38.000000000 +0100 >+++ pcre-8.34.oden/pcre.h.in 2014-02-07 19:43:10.756051138 +0100 >@@ -491,36 +491,42 @@ PCRE_EXP_DECL void (*pcre_free)(void *) > PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t); > PCRE_EXP_DECL void (*pcre_stack_free)(void *); > PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *); >+PCRE_EXP_DECL int (*pcre_stack_guard)(void); > > PCRE_EXP_DECL void *(*pcre16_malloc)(size_t); > PCRE_EXP_DECL void (*pcre16_free)(void *); > PCRE_EXP_DECL void *(*pcre16_stack_malloc)(size_t); > PCRE_EXP_DECL void (*pcre16_stack_free)(void *); > PCRE_EXP_DECL int (*pcre16_callout)(pcre16_callout_block *); >+PCRE_EXP_DECL int (*pcre16_stack_guard)(void); > > PCRE_EXP_DECL void *(*pcre32_malloc)(size_t); > PCRE_EXP_DECL void (*pcre32_free)(void *); > PCRE_EXP_DECL void *(*pcre32_stack_malloc)(size_t); > PCRE_EXP_DECL void (*pcre32_stack_free)(void *); > PCRE_EXP_DECL int (*pcre32_callout)(pcre32_callout_block *); >+PCRE_EXP_DECL int (*pcre32_stack_guard)(void); > #else /* VPCOMPAT */ > PCRE_EXP_DECL void *pcre_malloc(size_t); > PCRE_EXP_DECL void pcre_free(void *); > PCRE_EXP_DECL void *pcre_stack_malloc(size_t); > PCRE_EXP_DECL void pcre_stack_free(void *); > PCRE_EXP_DECL int pcre_callout(pcre_callout_block *); >+PCRE_EXP_DECL int pcre_stack_guard(void); > > PCRE_EXP_DECL void *pcre16_malloc(size_t); > PCRE_EXP_DECL void pcre16_free(void *); > PCRE_EXP_DECL void *pcre16_stack_malloc(size_t); > PCRE_EXP_DECL void pcre16_stack_free(void *); > PCRE_EXP_DECL int pcre16_callout(pcre16_callout_block *); >+PCRE_EXP_DECL int (*pcre16_stack_guard)(void); > > PCRE_EXP_DECL void *pcre32_malloc(size_t); > PCRE_EXP_DECL void pcre32_free(void *); > PCRE_EXP_DECL void *pcre32_stack_malloc(size_t); > PCRE_EXP_DECL void pcre32_stack_free(void *); > PCRE_EXP_DECL int pcre32_callout(pcre32_callout_block *); >+PCRE_EXP_DECL int (*pcre32_stack_guard)(void); > #endif /* VPCOMPAT */ > > /* User defined callback which provides a stack just before the match starts. */
diff -Naurp pcre-8.34/pcre_compile.c pcre-8.34.oden/pcre_compile.c --- pcre-8.34/pcre_compile.c 2013-12-15 17:56:22.000000000 +0100 +++ pcre-8.34.oden/pcre_compile.c 2014-02-07 19:43:10.759051139 +0100 @@ -7994,6 +7994,12 @@ unsigned int orig_bracount; unsigned int max_bracount; branch_chain bc; +if (PUBL(stack_guard) && PUBL(stack_guard)()) +{ + *errorcodeptr= ERR23; + return FALSE; +} + bc.outer = bcptr; bc.current_branch = code; diff -Naurp pcre-8.34/pcre_globals.c pcre-8.34.oden/pcre_globals.c --- pcre-8.34/pcre_globals.c 2012-01-05 18:07:07.000000000 +0100 +++ pcre-8.34.oden/pcre_globals.c 2014-02-07 19:43:10.760051139 +0100 @@ -72,6 +72,7 @@ PCRE_EXP_DATA_DEFN void (*PUBL(free))(v PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = LocalPcreMalloc; PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = LocalPcreFree; PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL; +PCRE_EXP_DATA_DEFN int (*PUBL(stack_guard))(void) = NULL; #elif !defined VPCOMPAT PCRE_EXP_DATA_DEFN void *(*PUBL(malloc))(size_t) = malloc; @@ -79,6 +80,7 @@ PCRE_EXP_DATA_DEFN void (*PUBL(free))(v PCRE_EXP_DATA_DEFN void *(*PUBL(stack_malloc))(size_t) = malloc; PCRE_EXP_DATA_DEFN void (*PUBL(stack_free))(void *) = free; PCRE_EXP_DATA_DEFN int (*PUBL(callout))(PUBL(callout_block) *) = NULL; +PCRE_EXP_DATA_DEFN int (*PUBL(stack_guard))(void) = NULL; #endif /* End of pcre_globals.c */ diff -Naurp pcre-8.34/pcre.h.in pcre-8.34.oden/pcre.h.in --- pcre-8.34/pcre.h.in 2013-11-12 16:09:38.000000000 +0100 +++ pcre-8.34.oden/pcre.h.in 2014-02-07 19:43:10.756051138 +0100 @@ -491,36 +491,42 @@ PCRE_EXP_DECL void (*pcre_free)(void *) PCRE_EXP_DECL void *(*pcre_stack_malloc)(size_t); PCRE_EXP_DECL void (*pcre_stack_free)(void *); PCRE_EXP_DECL int (*pcre_callout)(pcre_callout_block *); +PCRE_EXP_DECL int (*pcre_stack_guard)(void); PCRE_EXP_DECL void *(*pcre16_malloc)(size_t); PCRE_EXP_DECL void (*pcre16_free)(void *); PCRE_EXP_DECL void *(*pcre16_stack_malloc)(size_t); PCRE_EXP_DECL void (*pcre16_stack_free)(void *); PCRE_EXP_DECL int (*pcre16_callout)(pcre16_callout_block *); +PCRE_EXP_DECL int (*pcre16_stack_guard)(void); PCRE_EXP_DECL void *(*pcre32_malloc)(size_t); PCRE_EXP_DECL void (*pcre32_free)(void *); PCRE_EXP_DECL void *(*pcre32_stack_malloc)(size_t); PCRE_EXP_DECL void (*pcre32_stack_free)(void *); PCRE_EXP_DECL int (*pcre32_callout)(pcre32_callout_block *); +PCRE_EXP_DECL int (*pcre32_stack_guard)(void); #else /* VPCOMPAT */ PCRE_EXP_DECL void *pcre_malloc(size_t); PCRE_EXP_DECL void pcre_free(void *); PCRE_EXP_DECL void *pcre_stack_malloc(size_t); PCRE_EXP_DECL void pcre_stack_free(void *); PCRE_EXP_DECL int pcre_callout(pcre_callout_block *); +PCRE_EXP_DECL int pcre_stack_guard(void); PCRE_EXP_DECL void *pcre16_malloc(size_t); PCRE_EXP_DECL void pcre16_free(void *); PCRE_EXP_DECL void *pcre16_stack_malloc(size_t); PCRE_EXP_DECL void pcre16_stack_free(void *); PCRE_EXP_DECL int pcre16_callout(pcre16_callout_block *); +PCRE_EXP_DECL int (*pcre16_stack_guard)(void); PCRE_EXP_DECL void *pcre32_malloc(size_t); PCRE_EXP_DECL void pcre32_free(void *); PCRE_EXP_DECL void *pcre32_stack_malloc(size_t); PCRE_EXP_DECL void pcre32_stack_free(void *); PCRE_EXP_DECL int pcre32_callout(pcre32_callout_block *); +PCRE_EXP_DECL int (*pcre32_stack_guard)(void); #endif /* VPCOMPAT */ /* User defined callback which provides a stack just before the match starts. */
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 12665
: 4965