summaryrefslogtreecommitdiff
path: root/src/sp_utils.c (follow)
AgeCommit message (Collapse)Author
2024-06-14Fix a portability issuejvoisin
This should fix the following compilation issue: ``` /wrkdirs/usr/ports/security/snuffleupagus/work-php83/snuffleupagus-0.10.0/src/sp_utils.c:438:37: error: too few arguments provided to function-like macro invocation 438 | memcpy(mb_name, ZEND_STRL("mb_")); | ^ /usr/include/ssp/string.h:117:9: note: macro 'memcpy' defined here 117 | #define memcpy(dst, src, len) __ssp_bos_check3(memcpy, dst, src, len) ```
2024-06-06Declare file local variables and functions staticChristian Göttsche
Avoid missing prototype warnings by declaring variables and functions that are only used in a single file static.
2023-02-02Url encode functions arguments when logging themjvoisin
2023-02-01Fix a possible NULL-byte truncation when outputting parameters in the logsjvoisin
2023-01-31Add sp.log_max_lenjvoisin
2022-12-09Portability improvements for PHP8.2jvoisin
2022-07-13Even more const!jvoisin
2022-07-13More micro-optimizationsjvoisin
2022-07-13Minor micro-optimizationjvoisin
2022-07-13Remove some dead codejvoisin
2022-07-13Mix the stacktrace in the sha256 for the filename of .dump()jvoisin
This should make it easier to fuzz using Snuffleupagus.
2022-06-27Minor code simplificationjvoisin
2022-06-27Dump the eval'ed codejvoisin
2022-05-06Silence a compiler warningjvoisin
2022-02-05introduced sp_regexp / store original regexBen Fuhrmannek
2021-12-14fix: include class name in eval whitelist matchingBen Fuhrmannek
2021-11-30clarify control flowBen Fuhrmannek
2021-10-21added some array initialization, just in case.Ben Fuhrmannek
2021-09-23config is stack allocated now + some code improvements (see details)Ben Fuhrmannek
* for easier memory manegement, the entire sp_config struct was merged into snuffleupagus_globals and allocated on stack where possible * SNUFFLEUPAGUS_G() can be written as SPG(), which is faster to type and easier to read * execution_depth is re-initialized to 0 for each request * function calls with inline string and length parameters consistently use ZEND_STRL instead of sizeof()-1 * execution is actually hooked if recursion protection is enabled * some line breaks were removed to make the code more readable
2021-08-17removed unused variablesBen Fuhrmannek
2021-08-16fincy new scanner/parser for config rules + fixed a few bugs along the way + ↵Ben Fuhrmannek
fixed related unittests
2021-08-12missing efree in sp_log_msgfBen Fuhrmannek
2021-08-07fixed doulbe hookBen Fuhrmannek
2021-08-06restructured function hooks, implemented unhookBen Fuhrmannek
2021-08-03fixed incorrect use of free()/efree()Ben Fuhrmannek
2021-08-02Merge branch 'master' of https://github.com/jvoisin/snuffleupagusBen Fuhrmannek
2021-04-28A pass of clang-formatjvoisin
2021-04-28Simplify a bit get_ip()jvoisin
2021-02-18log forging protectionBen Fuhrmannek
2021-01-30Improve a bit type diversityjvoisin
2021-01-02Do a clang-format passjvoisin
2021-01-02Add stacktraces to dumpsjvoisin
2021-01-01Simplify a loop conditionjvoisin
2021-01-01Simplify sp_match_array_valuejvoisin
2021-01-01Constify a functionjvoisin
2020-12-19docs: fix simple typo, migitate -> mitigateTim Gates
There is a small typo in src/sp_utils.c. Should read `mitigate` rather than `migitate`.
2020-08-12Allow empty configuration (#342)jvoisin
This commit allows php to run (with a warning) if there is no specified snuffleupagus configuration, instead of refusing to start.
2020-07-22refactoring sp_log_* (#340)Giovanni
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
2020-07-21Fixed issue on impossible bailout.Giovanni Dante Grazioli
2020-07-21Fix #338 - added log type if type is simulation, drop or log. (#339)Giovanni
Co-authored-by: Giovanni Dante Grazioli <giovanni.dantegrazioli@nbs-system.com>
2020-07-12More constificationjvoisin
2020-07-12Use $_SERVER['REMOTE_ADDR'] in last resort to get the client's ip addrjvoisin
2020-07-08Add a couple of `restrict`jvoisin
2020-07-04Fix a small typojvoisin
2020-07-04Reorder some declarationjvoisin
So that the syslog part is tight as possible
2020-07-04Run clang-format on the codebasejvoisin
2020-07-04Factorize how snuffleupagus gets client's ip addrjvoisin
2020-07-04Fix a syslog-related issuejvoisin
Previously, the syslog logging would always go to LOG_ERR no matter the severity.
2019-11-03Log ip addresseskkadosh
2019-08-31Support direct syslog loggingThibault "bui" Koechlin
Add the possibility to log directly into the syslog, instead of using php's log system.