@@ -1684,7 +1684,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1684
1684
return 0 ;
1685
1685
}
1686
1686
1687
- data = apr_pcalloc (rule -> ruleset -> mp , var -> value_len + 1 );
1687
+ data = apr_pcalloc (msr -> mp , var -> value_len + 1 );
1688
1688
1689
1689
if (data == NULL ) {
1690
1690
* error_msg = "Internal Error: cannot allocate memory for data." ;
@@ -1699,18 +1699,18 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1699
1699
{
1700
1700
for (i = 0 ; i < rv ; ++ i )
1701
1701
{
1702
- match = apr_psprintf (rule -> ruleset -> mp , "%.*s" , ovector [2 * i + 1 ] - ovector [2 * i ], data + ovector [2 * i ]);
1702
+ match = apr_psprintf (msr -> mp , "%.*s" , ovector [2 * i + 1 ] - ovector [2 * i ], data + ovector [2 * i ]);
1703
1703
1704
1704
if (match == NULL ) {
1705
1705
* error_msg = "Internal Error: cannot allocate memory for match." ;
1706
1706
return -1 ;
1707
1707
}
1708
1708
1709
- match = remove_escape (rule -> ruleset -> mp , match , strlen (match ));
1709
+ match = remove_escape (msr -> mp , match , strlen (match ));
1710
1710
1711
- match = gsb_replace_tpath (rule -> ruleset -> mp , match , strlen (match ));
1711
+ match = gsb_replace_tpath (msr -> mp , match , strlen (match ));
1712
1712
1713
- match = gsb_reduce_char (rule -> ruleset -> mp , match );
1713
+ match = gsb_reduce_char (msr -> mp , match );
1714
1714
1715
1715
match_length = strlen (match );
1716
1716
@@ -1732,7 +1732,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1732
1732
log_escape_nq (msr -> mp , match ));
1733
1733
}
1734
1734
1735
- str = apr_pstrdup (rule -> ruleset -> mp ,match );
1735
+ str = apr_pstrdup (msr -> mp ,match );
1736
1736
1737
1737
base = apr_strtok (str ,"/" ,& savedptr );
1738
1738
if (base != NULL )
@@ -1744,7 +1744,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1744
1744
/* append / in the end of full url */
1745
1745
if ((match [match_length - 1 ] != '/' ) && (strchr (match ,'?' ) == NULL )) {
1746
1746
1747
- canon = apr_psprintf (rule -> ruleset -> mp , "%s/" , match );
1747
+ canon = apr_psprintf (msr -> mp , "%s/" , match );
1748
1748
if (canon != NULL ) {
1749
1749
1750
1750
canon_length = strlen (canon );
@@ -1757,7 +1757,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1757
1757
log_escape_nq (msr -> mp , canon ));
1758
1758
}
1759
1759
1760
- str = apr_pstrdup (rule -> ruleset -> mp ,match );
1760
+ str = apr_pstrdup (msr -> mp ,match );
1761
1761
1762
1762
base = apr_strtok (str ,"/" ,& savedptr );
1763
1763
if (base != NULL )
@@ -1770,7 +1770,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1770
1770
1771
1771
/* Parsing full url */
1772
1772
1773
- domain = apr_pstrdup (rule -> ruleset -> mp , match );
1773
+ domain = apr_pstrdup (msr -> mp , match );
1774
1774
1775
1775
domain_len = strlen (domain );
1776
1776
@@ -1785,7 +1785,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1785
1785
1786
1786
dot = strchr (domain ,'.' );
1787
1787
if (dot != NULL ) {
1788
- canon = apr_pstrdup (rule -> ruleset -> mp , domain );
1788
+ canon = apr_pstrdup (msr -> mp , domain );
1789
1789
1790
1790
ret = verify_gsb (gsb , msr , canon , strlen (canon ));
1791
1791
@@ -1796,7 +1796,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1796
1796
log_escape_nq (msr -> mp , canon ));
1797
1797
}
1798
1798
1799
- str = apr_pstrdup (rule -> ruleset -> mp ,match );
1799
+ str = apr_pstrdup (msr -> mp ,match );
1800
1800
1801
1801
base = apr_strtok (str ,"/" ,& savedptr );
1802
1802
if (base != NULL )
@@ -1818,7 +1818,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1818
1818
log_escape_nq (msr -> mp , base ));
1819
1819
}
1820
1820
1821
- str = apr_pstrdup (rule -> ruleset -> mp ,match );
1821
+ str = apr_pstrdup (msr -> mp ,match );
1822
1822
1823
1823
base = apr_strtok (str ,"/" ,& savedptr );
1824
1824
if (base != NULL )
@@ -1829,13 +1829,13 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1829
1829
1830
1830
}
1831
1831
1832
- url = apr_palloc (rule -> ruleset -> mp , strlen (canon ));
1832
+ url = apr_palloc (msr -> mp , strlen (canon ));
1833
1833
count_slash = 0 ;
1834
1834
1835
1835
while (* canon != '\0' ) {
1836
1836
switch (* canon ) {
1837
1837
case '/' :
1838
- ptr = apr_psprintf (rule -> ruleset -> mp ,"%s/" ,url );
1838
+ ptr = apr_psprintf (msr -> mp ,"%s/" ,url );
1839
1839
ret = verify_gsb (gsb , msr , ptr , strlen (ptr ));
1840
1840
if (ret > 0 ) {
1841
1841
set_match_to_tx (msr , capture , ptr , 0 );
@@ -1844,7 +1844,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1844
1844
log_escape_nq (msr -> mp , ptr ));
1845
1845
}
1846
1846
1847
- str = apr_pstrdup (rule -> ruleset -> mp ,match );
1847
+ str = apr_pstrdup (msr -> mp ,match );
1848
1848
1849
1849
base = apr_strtok (str ,"/" ,& savedptr );
1850
1850
if (base != NULL )
@@ -1871,7 +1871,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1871
1871
}
1872
1872
1873
1873
1874
- str = apr_pstrdup (rule -> ruleset -> mp , match );
1874
+ str = apr_pstrdup (msr -> mp , match );
1875
1875
1876
1876
while (* str != '\0' ) {
1877
1877
@@ -1896,7 +1896,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1896
1896
1897
1897
dot = strchr (domain ,'.' );
1898
1898
if (dot != NULL ) {
1899
- canon = apr_pstrdup (rule -> ruleset -> mp , domain );
1899
+ canon = apr_pstrdup (msr -> mp , domain );
1900
1900
1901
1901
ret = verify_gsb (gsb , msr , canon , strlen (canon ));
1902
1902
@@ -1906,7 +1906,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1906
1906
* error_msg = apr_psprintf (msr -> mp , "Gsb lookup for \"%s\" succeeded." ,
1907
1907
log_escape_nq (msr -> mp , canon ));
1908
1908
}
1909
- str = apr_pstrdup (rule -> ruleset -> mp ,match );
1909
+ str = apr_pstrdup (msr -> mp ,match );
1910
1910
1911
1911
base = apr_strtok (str ,"/" ,& savedptr );
1912
1912
if (base != NULL )
@@ -1926,7 +1926,7 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1926
1926
* error_msg = apr_psprintf (msr -> mp , "Gsb lookup for \"%s\" succeeded." ,
1927
1927
log_escape_nq (msr -> mp , base ));
1928
1928
}
1929
- str = apr_pstrdup (rule -> ruleset -> mp ,match );
1929
+ str = apr_pstrdup (msr -> mp ,match );
1930
1930
1931
1931
base = apr_strtok (str ,"/" ,& savedptr );
1932
1932
if (base != NULL )
@@ -1936,21 +1936,21 @@ static int msre_op_gsbLookup_execute(modsec_rec *msr, msre_rule *rule, msre_var
1936
1936
1937
1937
}
1938
1938
1939
- url = apr_palloc (rule -> ruleset -> mp , strlen (canon ));
1939
+ url = apr_palloc (msr -> mp , strlen (canon ));
1940
1940
count_slash = 0 ;
1941
1941
1942
1942
while (* canon != '\0' ) {
1943
1943
switch (* canon ) {
1944
1944
case '/' :
1945
- ptr = apr_psprintf (rule -> ruleset -> mp ,"%s/" ,url );
1945
+ ptr = apr_psprintf (msr -> mp ,"%s/" ,url );
1946
1946
ret = verify_gsb (gsb , msr , ptr , strlen (ptr ));
1947
1947
if (ret > 0 ) {
1948
1948
set_match_to_tx (msr , capture , ptr , 0 );
1949
1949
if (! * error_msg ) {
1950
1950
* error_msg = apr_psprintf (msr -> mp , "Gsb lookup for \"%s\" succeeded." ,
1951
1951
log_escape_nq (msr -> mp , ptr ));
1952
1952
}
1953
- str = apr_pstrdup (rule -> ruleset -> mp ,match );
1953
+ str = apr_pstrdup (msr -> mp ,match );
1954
1954
1955
1955
base = apr_strtok (str ,"/" ,& savedptr );
1956
1956
if (base != NULL )
@@ -2781,7 +2781,7 @@ static int msre_op_verifyCC_execute(modsec_rec *msr, msre_rule *rule, msre_var *
2781
2781
if (msr -> txcfg -> debuglog_level >= 4 ) {
2782
2782
rc = msc_fullinfo (regex , PCRE_INFO_JIT , & jit );
2783
2783
if ((rc != 0 ) || (jit != 1 )) {
2784
- * error_msg = apr_psprintf (rule -> ruleset -> mp ,
2784
+ * error_msg = apr_psprintf (msr -> mp ,
2785
2785
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
2786
2786
"Execution error - "
2787
2787
"Does not support JIT (%d)" ,
@@ -3092,7 +3092,7 @@ static int msre_op_verifyCPF_execute(modsec_rec *msr, msre_rule *rule, msre_var
3092
3092
if (msr -> txcfg -> debuglog_level >= 4 ) {
3093
3093
rc = msc_fullinfo (regex , PCRE_INFO_JIT , & jit );
3094
3094
if ((rc != 0 ) || (jit != 1 )) {
3095
- * error_msg = apr_psprintf (rule -> ruleset -> mp ,
3095
+ * error_msg = apr_psprintf (msr -> mp ,
3096
3096
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
3097
3097
"Execution error - "
3098
3098
"Does not support JIT (%d)" ,
@@ -3386,7 +3386,7 @@ static int msre_op_verifySSN_execute(modsec_rec *msr, msre_rule *rule, msre_var
3386
3386
if (msr -> txcfg -> debuglog_level >= 4 ) {
3387
3387
rc = msc_fullinfo (regex , PCRE_INFO_JIT , & jit );
3388
3388
if ((rc != 0 ) || (jit != 1 )) {
3389
- * error_msg = apr_psprintf (rule -> ruleset -> mp ,
3389
+ * error_msg = apr_psprintf (msr -> mp ,
3390
3390
"Rule %pp [id \"%s\"][file \"%s\"][line \"%d\"] - "
3391
3391
"Execution error - "
3392
3392
"Does not support JIT (%d)" ,
@@ -3967,7 +3967,7 @@ static int msre_op_fuzzy_hash_execute(modsec_rec *msr, msre_rule *rule,
3967
3967
#ifdef WITH_SSDEEP
3968
3968
if (fuzzy_hash_buf (var -> value , var -> value_len , result ))
3969
3969
{
3970
- * error_msg = apr_psprintf (rule -> ruleset -> mp , "Problems generating " \
3970
+ * error_msg = apr_psprintf (msr -> mp , "Problems generating " \
3971
3971
"fuzzy hash." );
3972
3972
3973
3973
return -1 ;
@@ -3987,7 +3987,7 @@ static int msre_op_fuzzy_hash_execute(modsec_rec *msr, msre_rule *rule,
3987
3987
chunk = chunk -> next ;
3988
3988
}
3989
3989
#else
3990
- * error_msg = apr_psprintf (rule -> ruleset -> mp , "ModSecurity was not " \
3990
+ * error_msg = apr_psprintf (msr -> mp , "ModSecurity was not " \
3991
3991
"compiled with ssdeep support." );
3992
3992
3993
3993
return -1 ;
0 commit comments