Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: sandbox/linux/seccomp/maps.cc

Issue 1807002: Correctly align memory allocations in the case where we need to allocate memo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp/maps.cc
===================================================================
--- sandbox/linux/seccomp/maps.cc (revision 45661)
+++ sandbox/linux/seccomp/maps.cc (working copy)
@@ -221,7 +221,10 @@
static_cast<unsigned long>(addr) - kMaxDistance < gap_start) {
position = gap_start;
} else {
- position = addr - kMaxDistance;
+ position = (addr - kMaxDistance) & ~4095;
+ if (position < gap_start) {
+ position = gap_start;
+ }
}
} else {
// Otherwise, take the end of the region.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698