File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change 2
2
#define RLBOX_USE_STATIC_CALLS () rlbox_noop_sandbox_lookup_symbol
3
3
4
4
#include < stdio.h>
5
+ #include < cassert>
5
6
#include < rlbox/rlbox.hpp>
6
7
#include < rlbox/rlbox_noop_sandbox.hpp>
7
8
#include " mylib.h"
@@ -12,7 +13,8 @@ void hello_cb(rlbox_sandbox<rlbox_noop_sandbox>& _,
12
13
tainted<const char *, rlbox_noop_sandbox> str) {
13
14
auto checked_string =
14
15
str.copy_and_verify_string ([](std::unique_ptr<char []> val) {
15
- return std::strlen (val.get ()) < 1024 ? std::move (val) : nullptr ;
16
+ assert (val != nullptr && std::strlen (val.get ()) < 1024 );
17
+ return std::move (val);
16
18
});
17
19
printf (" hello_cb: %s\n " , checked_string.get ());
18
20
}
Original file line number Diff line number Diff line change 2
2
#define RLBOX_USE_STATIC_CALLS () rlbox_noop_sandbox_lookup_symbol
3
3
4
4
#include < stdio.h>
5
+ #include < cassert>
5
6
#include " mylib.h"
6
7
#include " ../../code/include/rlbox.hpp"
7
8
#include " ../../code/include/rlbox_noop_sandbox.hpp"
@@ -12,7 +13,8 @@ void hello_cb(rlbox_sandbox<rlbox_noop_sandbox>& _,
12
13
tainted<const char *, rlbox_noop_sandbox> str) {
13
14
auto checked_string =
14
15
str.copy_and_verify_string ([](std::unique_ptr<char []> val) {
15
- return std::strlen (val.get ()) < 1024 ? std::move (val) : nullptr ;
16
+ assert (val != nullptr && std::strlen (val.get ()) < 1024 );
17
+ return std::move (val);
16
18
});
17
19
printf (" hello_cb: %s\n " , checked_string.get ());
18
20
}
You can’t perform that action at this time.
0 commit comments