summaryrefslogtreecommitdiff
path: root/src/sp_upload_validation.c (follow)
AgeCommit message (Collapse)Author
2025-06-25Cast format argument to expected typeChristian Göttsche
Please GCC conversion warning: src/sp_upload_validation.c: In function 'sp_rfc1867_callback': src/sp_utils.h:61:53: warning: format '%lld' expects argument of type 'long long int', but argument 7 has type 'zend_long' {aka 'long int'} [-Wformat=] 61 | if (sp_debug_stderr > 0) dprintf(sp_debug_stderr, "[snuffleupagus][DEBUG] %s(): " fmt "\n", __FUNCTION__, ##__VA_ARGS__); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/sp_upload_validation.c:48:7: note: in expansion of macro 'sp_log_debug' 48 | sp_log_debug("Filename: %s\nTmpname: %s\nSize: %zd\nError: %lld\nScript: %s", | ^~~~~~~~~~~~
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.
2021-12-20removed confusung newlines for better reading/searchingBen 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-07fixed compiler warningBen Fuhrmannek
2021-05-09Add some checks to prevent recursion upon config reloadingjvoisin
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-03-04%s/nbs-system/jvoisinjvoisin
Since I'm the only one to maintain Snuffleupagus, let's adjust the links and contact addresses of my fork, to point to well… my fork.
2019-06-20Fix snufflepagus_globals linking issues and one mac compatibility issuebef
2019-02-23Try to unify the includesjvoisin
2018-10-25Snuffleupagus should now compile on Windowsjvoisin
2018-10-09Remove 3 useless linesjvoisin
2018-10-06Bump a bit the coveragejvoisin
* `setcookie` doesn't always return `true` anymore * clang-format * Cookies with invalid decryption are dropped, but the request isn't anymore * faulty unserialize are now dumpable
2018-10-06Remove sp_terminate and bump a bit the coveragejvoisin
2018-08-30Minor code cleanupxXx-caillou-xXx
2018-08-28Use php's logging functionsxXx-caillou-xXx
This commit replace our usage of `php_log_err` with `zend_error`. This should allow administrators to display errors in the webpage, should they want to; and to properly manipulate the verbosity's level. This should close #217
2018-08-09Yet an other crash/hang fixjvoisin
Like the two previous commits
2018-07-13Massively optimize how rules are handledxXx-caillou-xXx
This commit does a lot of things: - Use hashtables instead of lists to store the rules - Rules that can be applied at launch time won't be tried at runtime - Improve feedback when writing nonsensical rules - Make intensive use of `zend_string` instead of `char*`
2017-12-28Bump again the coveragejvoisin
2017-12-28Clang-format passThibault "bui" Koechlin
- `clang-format --style="{BasedOnStyle: google, SortIncludes: false}" -i snuffleu*.c sp_*.c sp_*.h` - Update the documentation accordingly
2017-12-20Better parsing of the rulesxXx-caillou-xXx
Thanks to this huge commit from @xXx-caillou-xXx, we can now write amazingly flexible rules.
2017-10-23Add some tests for upload validation and fix a related typojvoisin
2017-10-13Fix some pedantic warningsjvoisin
2017-10-10Make the `simulation` mode logs more obviousjvoisin
2017-09-21Add travisjvoisin
2017-09-20Initial importSebastien Blot