Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/topic/bbannier/unset-hooks'
Browse files Browse the repository at this point in the history
  • Loading branch information
bbannier committed May 15, 2024
2 parents b41aaeb + 3bf7e97 commit b877696
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
1.11.0-dev.168 | 2024-05-15 10:19:54 +0200

* Fix behavior for unset accept and decline hooks. (Benjamin Bannier, Corelight)

We did not properly initialize pointer values for accept and decline
hooks. In downstream code they then appeared to be set when they were in
fact not.

With this patch we initialize them with proper defaults.

1.11.0-dev.166 | 2024-05-14 11:54:16 +0200

* Docs: Add new section with guidelines and best practices. (Robin Sommer, Corelight)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.11.0-dev.166
1.11.0-dev.168
4 changes: 2 additions & 2 deletions spicy/runtime/include/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct Configuration {
* Optional callback to execute when a Spicy parser calls
* `spicy::accept_input()`.
**/
HookAcceptInput hook_accept_input;
HookAcceptInput hook_accept_input = nullptr;

using HookDeclineInput = void (*)(const std::string&);

Expand All @@ -29,7 +29,7 @@ struct Configuration {
* `spicy::decline_input()`. This string argument is the reason provided by
* the caller.
*/
HookDeclineInput hook_decline_input;
HookDeclineInput hook_decline_input = nullptr;
};

namespace configuration {
Expand Down

0 comments on commit b877696

Please sign in to comment.