mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Explicitly narrow size argument for BPF
This fixes a build error introduced in 26da6e6b0a
.
PiperOrigin-RevId: 414408033
Change-Id: Ic34d5eeba3bb34f9a5ce46a05547129fbab8bce0
This commit is contained in:
parent
4e6cafa934
commit
60eb52c17f
|
@ -742,7 +742,8 @@ PolicyBuilder& PolicyBuilder::AddPolicyOnSyscalls(
|
||||||
// over it.
|
// over it.
|
||||||
if (last) {
|
if (last) {
|
||||||
if (out.size() > kMaxShortJump) {
|
if (out.size() > kMaxShortJump) {
|
||||||
out.push_front(BPF_STMT(BPF_JMP + BPF_JA, out.size()));
|
out.push_front(
|
||||||
|
BPF_STMT(BPF_JMP + BPF_JA, static_cast<uint32_t>(out.size())));
|
||||||
} else {
|
} else {
|
||||||
jf = out.size();
|
jf = out.size();
|
||||||
}
|
}
|
||||||
|
@ -751,7 +752,8 @@ PolicyBuilder& PolicyBuilder::AddPolicyOnSyscalls(
|
||||||
// Add a helper absolute jump if needed - the policy/last helper jump is
|
// Add a helper absolute jump if needed - the policy/last helper jump is
|
||||||
// out of reach of a short jump.
|
// out of reach of a short jump.
|
||||||
if ((out.size() - do_policy_loc) > kMaxShortJump) {
|
if ((out.size() - do_policy_loc) > kMaxShortJump) {
|
||||||
out.push_front(BPF_STMT(BPF_JMP + BPF_JA, out.size() - policy.size()));
|
out.push_front(BPF_STMT(
|
||||||
|
BPF_JMP + BPF_JA, static_cast<uint32_t>(out.size() - policy.size())));
|
||||||
do_policy_loc = out.size();
|
do_policy_loc = out.size();
|
||||||
++jf;
|
++jf;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user