1 $NetBSD: patch-ee,v 1.1 2008/12/13 00:42:26 martin Exp $
3 # reported upstream as: https://bugzilla.mozilla.org/show_bug.cgi?id=469276
5 --- toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp.orig 2008-08-25 22:59:14.000000000 +0200
6 +++ toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp 2008-12-12 16:31:11.000000000 +0100
8 return NS_ERROR_FAILURE;
10 const nsCSubstring& str = Substring(chunk, start, 4);
11 - const PRUint32 *p = reinterpret_cast<const PRUint32*>(str.BeginReading());
12 - entry->mAddChunkId = PR_ntohl(*p);
14 + memcpy(&p, str.BeginReading(), 4);
15 + entry->mAddChunkId = PR_ntohl(p);
16 if (entry->mAddChunkId == 0) {
17 NS_WARNING("Received invalid chunk number.");
18 return NS_ERROR_FAILURE;
21 if (chunkType == CHUNK_SUB) {
22 const nsCSubstring& str = Substring(chunk, start, 4);
23 - const PRUint32 *p = reinterpret_cast<const PRUint32*>(str.BeginReading());
24 - entry->mAddChunkId = PR_ntohl(*p);
26 + memcpy(&p, str.BeginReading(), 4);
27 + entry->mAddChunkId = PR_ntohl(p);
28 if (entry->mAddChunkId == 0) {
29 NS_WARNING("Received invalid chunk number.");
30 return NS_ERROR_FAILURE;