diff options
author | martin <martin@pkgsrc.org> | 2015-02-08 09:36:31 +0000 |
---|---|---|
committer | martin <martin@pkgsrc.org> | 2015-02-08 09:36:31 +0000 |
commit | 1522f5f8a813c28d1f9daa42c457a3b7efa4a461 (patch) | |
tree | cc57cc7d44b85abd6c257dd432083aea8655b34b /www/firefox | |
parent | 395e076b86a0008164c68a172bf475c9d692d972 (diff) | |
download | pkgsrc-1522f5f8a813c28d1f9daa42c457a3b7efa4a461.tar.gz |
Make it work on strict alignment architectures again.
Diffstat (limited to 'www/firefox')
-rw-r--r-- | www/firefox/Makefile | 4 | ||||
-rw-r--r-- | www/firefox/distinfo | 3 | ||||
-rw-r--r-- | www/firefox/patches/patch-netwerk_protocol_http_Http2Session.cpp | 130 |
3 files changed, 134 insertions, 3 deletions
diff --git a/www/firefox/Makefile b/www/firefox/Makefile index dc1b7529d06..a9d3e2210c4 100644 --- a/www/firefox/Makefile +++ b/www/firefox/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.190 2015/01/30 15:19:59 ryoon Exp $ +# $NetBSD: Makefile,v 1.191 2015/02/08 09:36:31 martin Exp $ FIREFOX_VER= ${MOZ_BRANCH}${MOZ_BRANCH_MINOR} MOZ_BRANCH= 35.0 @@ -6,7 +6,7 @@ MOZ_BRANCH_MINOR= .1 DISTNAME= firefox-${FIREFOX_VER}.source PKGNAME= firefox-${MOZ_BRANCH}${MOZ_BRANCH_MINOR:S/b/beta/:S/esr//} -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= www MASTER_SITES= ${MASTER_SITE_MOZILLA:=firefox/releases/${FIREFOX_VER}/source/} MASTER_SITES+= ${MASTER_SITE_MOZILLA_ALL:=firefox/releases/${FIREFOX_VER}/source/} diff --git a/www/firefox/distinfo b/www/firefox/distinfo index 984032c9c48..6e14e83f4c5 100644 --- a/www/firefox/distinfo +++ b/www/firefox/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.182 2015/01/30 15:19:59 ryoon Exp $ +$NetBSD: distinfo,v 1.183 2015/02/08 09:36:31 martin Exp $ SHA1 (firefox-35.0.1.source.tar.bz2) = cf256ee1491ee502eb4432ade5a879104ebceede RMD160 (firefox-35.0.1.source.tar.bz2) = ca4dc6f6c5de1e6e69133de3b8b502991d519fa7 @@ -119,6 +119,7 @@ SHA1 (patch-mfbt_Poison.cpp) = f502581db96b3e5eca25a9aa9035f436e9167503 SHA1 (patch-modules_libjar_nsZipArchive.cpp) = 6aff0f8ed42575d8ca36a524e12e9a1f7351004a SHA1 (patch-netwerk_dns_Makefile.in) = b6bd9814d909dd6f7cff10dbeac3bedd79c2508e SHA1 (patch-netwerk_dns_moz.build) = 01dd7d9094ddaeffbcd6cfa296e28fb56681b0e6 +SHA1 (patch-netwerk_protocol_http_Http2Session.cpp) = 7c864e9bdeb3c76b3ff908f37c1a00a94bfeaad0 SHA1 (patch-netwerk_wifi_moz.build) = 7c84003d442f698b030f3fef91fea2f5537b404c SHA1 (patch-netwerk_wifi_nsWifiScannerFreeBSD.cpp) = d43961a396bccc6bbe1dba2b4c1f97d5017c6d6d SHA1 (patch-pb) = 97c9b2e4cefd524dc6ba825f71c3da2a761aa1f4 diff --git a/www/firefox/patches/patch-netwerk_protocol_http_Http2Session.cpp b/www/firefox/patches/patch-netwerk_protocol_http_Http2Session.cpp new file mode 100644 index 00000000000..ea07b022a78 --- /dev/null +++ b/www/firefox/patches/patch-netwerk_protocol_http_Http2Session.cpp @@ -0,0 +1,130 @@ +$NetBSD: patch-netwerk_protocol_http_Http2Session.cpp,v 1.1 2015/02/08 09:36:31 martin Exp $ + +https://bugzilla.mozilla.org/show_bug.cgi?id=1130822 +Fix obivous alignment issues (causing crashes on some architectures). + +--- netwerk/protocol/http/Http2Session.cpp.orig 2015-01-23 07:00:06.000000000 +0100 ++++ netwerk/protocol/http/Http2Session.cpp 2015-02-08 09:04:00.000000000 +0100 +@@ -1288,8 +1288,9 @@ + if (NS_FAILED(rv)) + return rv; + +- uint32_t newPriorityDependency = +- PR_ntohl(*reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get() + kFrameHeaderBytes)); ++ uint32_t newPriorityDependency; ++ memcpy(&newPriorityDependency, self->mInputFrameBuffer.get() + kFrameHeaderBytes, 4); ++ newPriorityDependency = PR_ntohl(newPriorityDependency); + bool exclusive = !!(newPriorityDependency & 0x80000000); + newPriorityDependency &= 0x7fffffff; + uint8_t newPriorityWeight = *(self->mInputFrameBuffer.get() + kFrameHeaderBytes + 4); +@@ -1319,8 +1320,9 @@ + RETURN_SESSION_ERROR(self, PROTOCOL_ERROR); + } + +- self->mDownstreamRstReason = +- PR_ntohl(*reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get() + kFrameHeaderBytes)); ++ uint32_t tmp; ++ memcpy(&tmp, self->mInputFrameBuffer.get() + kFrameHeaderBytes, 4); ++ self->mDownstreamRstReason = PR_ntohl(tmp); + + LOG3(("Http2Session::RecvRstStream %p RST_STREAM Reason Code %u ID %x\n", + self, self->mDownstreamRstReason, self->mInputFrameID)); +@@ -1381,8 +1383,12 @@ + uint8_t *setting = reinterpret_cast<uint8_t *> + (self->mInputFrameBuffer.get()) + kFrameHeaderBytes + index * 6; + +- uint16_t id = PR_ntohs(*reinterpret_cast<uint16_t *>(setting)); +- uint32_t value = PR_ntohl(*reinterpret_cast<uint32_t *>(setting + 2)); ++ uint16_t id; ++ memcpy(&id, setting, 2); ++ id = PR_ntohs(id); ++ uint32_t value; ++ memcpy(&value, setting + 2, 4); ++ value = PR_ntohl(value); + LOG3(("Settings ID %u, Value %u", id, value)); + + switch (id) +@@ -1466,8 +1472,8 @@ + return rv; + } + promiseLen = 4; +- promisedID = +- PR_ntohl(*reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get() + kFrameHeaderBytes + paddingControlBytes)); ++ memcpy(&promisedID, self->mInputFrameBuffer.get() + kFrameHeaderBytes + paddingControlBytes, 4); ++ promisedID = PR_ntohl(promisedID); + promisedID &= 0x7fffffff; + } + +@@ -1701,12 +1707,14 @@ + } + + self->mShouldGoAway = true; +- self->mGoAwayID = +- PR_ntohl(*reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get() + kFrameHeaderBytes)); ++ uint32_t tmp; ++ memcpy(&tmp, self->mInputFrameBuffer.get() + kFrameHeaderBytes, 4); ++ self->mGoAwayID = PR_ntohl(tmp); + self->mGoAwayID &= 0x7fffffff; + self->mCleanShutdown = true; +- uint32_t statusCode = +- PR_ntohl(*reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get() + kFrameHeaderBytes + 4)); ++ uint32_t statusCode; ++ memcpy(&statusCode, self->mInputFrameBuffer.get() + kFrameHeaderBytes + 4, 4); ++ statusCode = PR_ntohl(statusCode); + + // Find streams greater than the last-good ID and mark them for deletion + // in the mGoAwayStreamsToRestart queue with the GoAwayEnumerator. The +@@ -1771,8 +1779,9 @@ + RETURN_SESSION_ERROR(self, PROTOCOL_ERROR); + } + +- uint32_t delta = +- PR_ntohl(*reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get() + kFrameHeaderBytes)); ++ uint32_t delta; ++ memcpy(&delta, self->mInputFrameBuffer.get() + kFrameHeaderBytes, 4); ++ delta = PR_ntohl(delta); + delta &= 0x7fffffff; + + LOG3(("Http2Session::RecvWindowUpdate %p len=%d Stream 0x%X.\n", +@@ -1964,10 +1973,12 @@ + RETURN_SESSION_ERROR(self, FRAME_SIZE_ERROR); + } + +- uint32_t maxAge = +- PR_ntohl(*reinterpret_cast<uint32_t *>(self->mInputFrameBuffer.get() + kFrameHeaderBytes)); +- uint16_t portRoute = +- PR_ntohs(*reinterpret_cast<uint16_t *>(self->mInputFrameBuffer.get() + kFrameHeaderBytes + 4)); ++ uint32_t maxAge; ++ memcpy(&maxAge, self->mInputFrameBuffer.get() + kFrameHeaderBytes, 4); ++ maxAge = PR_ntohl(maxAge); ++ uint16_t portRoute; ++ memcpy(&portRoute, self->mInputFrameBuffer.get() + kFrameHeaderBytes + 4, 2); ++ portRoute = PR_ntohs(portRoute); + uint8_t protoLen = self->mInputFrameBuffer.get()[kFrameHeaderBytes + 6]; + LOG3(("Http2Session::RecvAltSvc %p maxAge=%d port=%d protoLen=%d", self, + maxAge, portRoute, protoLen)); +@@ -2415,16 +2426,18 @@ + } + + // 3 bytes of length, 1 type byte, 1 flag byte, 1 unused bit, 31 bits of ID +- uint8_t totallyWastedByte = mInputFrameBuffer.get()[0]; +- mInputFrameDataSize = PR_ntohs(*reinterpret_cast<uint16_t *>(mInputFrameBuffer.get() + 1)); ++ const uint8_t *buf = reinterpret_cast<uint8_t*>(mInputFrameBuffer.get()); ++ uint8_t totallyWastedByte = buf[0]; ++ mInputFrameDataSize = buf[1] | (buf[2] << 8); + if (totallyWastedByte || (mInputFrameDataSize > kMaxFrameData)) { + LOG3(("Got frame too large 0x%02X%04X", totallyWastedByte, mInputFrameDataSize)); + RETURN_SESSION_ERROR(this, PROTOCOL_ERROR); + } +- mInputFrameType = *reinterpret_cast<uint8_t *>(mInputFrameBuffer.get() + kFrameLengthBytes); +- mInputFrameFlags = *reinterpret_cast<uint8_t *>(mInputFrameBuffer.get() + kFrameLengthBytes + kFrameTypeBytes); +- mInputFrameID = +- PR_ntohl(*reinterpret_cast<uint32_t *>(mInputFrameBuffer.get() + kFrameLengthBytes + kFrameTypeBytes + kFrameFlagBytes)); ++ mInputFrameType = buf[kFrameLengthBytes]; ++ mInputFrameFlags = buf[kFrameLengthBytes + kFrameTypeBytes]; ++ uint32_t v; ++ memcpy(&v, &buf[kFrameLengthBytes + kFrameTypeBytes + kFrameFlagBytes], 4); ++ mInputFrameID = PR_ntohl(v); + mInputFrameID &= 0x7fffffff; + mInputFrameDataRead = 0; + |