diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2010-02-23 16:44:55 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2010-03-01 22:29:40 -0500 |
commit | 952847a6e2d53b33cea39d13255fd0f7c8075942 (patch) | |
tree | 8ec0e1401efb77bde1dd7bf69197a8e10dcc9b6b | |
parent | 8c3bffeccbd0074e04adf894199393580de88e95 (diff) | |
download | pango-952847a6e2d53b33cea39d13255fd0f7c8075942.tar.gz |
Make blob unlocking 64bit-safe
Bug 604128 - Applications crash when displaying Hebrew characters
-rw-r--r-- | pango/opentype/hb-blob.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/pango/opentype/hb-blob.c b/pango/opentype/hb-blob.c index 107cd432..3348a38b 100644 --- a/pango/opentype/hb-blob.c +++ b/pango/opentype/hb-blob.c @@ -243,18 +243,18 @@ static hb_bool_t _try_make_writable_inplace_unix_locked (hb_blob_t *blob) { #if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MPROTECT) - unsigned int pagesize = -1, mask, length; + uintptr_t pagesize = -1, mask, length; const char *addr; #if defined(HAVE_SYSCONF) && defined(_SC_PAGE_SIZE) - pagesize = (unsigned int) sysconf (_SC_PAGE_SIZE); + pagesize = (uintptr_t) sysconf (_SC_PAGE_SIZE); #elif defined(HAVE_SYSCONF) && defined(_SC_PAGESIZE) - pagesize = (unsigned int) sysconf (_SC_PAGESIZE); + pagesize = (uintptr_t) sysconf (_SC_PAGESIZE); #elif defined(HAVE_GETPAGESIZE) - pagesize = (unsigned int) getpagesize (); + pagesize = (uintptr_t) getpagesize (); #endif - if ((unsigned int) -1 == pagesize) { + if ((uintptr_t) -1L == pagesize) { #if HB_DEBUG_BLOB fprintf (stderr, "%p %s: failed to get pagesize: %s\n", blob, __FUNCTION__, strerror (errno)); #endif @@ -265,8 +265,8 @@ _try_make_writable_inplace_unix_locked (hb_blob_t *blob) #endif mask = ~(pagesize-1); - addr = (const char *) (((size_t) blob->data) & mask); - length = (const char *) (((size_t) blob->data + blob->length + pagesize-1) & mask) - addr; + addr = (const char *) (((uintptr_t) blob->data) & mask); + length = (const char *) (((uintptr_t) blob->data + blob->length + pagesize-1) & mask) - addr; #if HB_DEBUG_BLOB fprintf (stderr, "%p %s: calling mprotect on [%p..%p] (%d bytes)\n", blob, __FUNCTION__, |