aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-3.3/090-CVE-2013-1763.patch
blob: 6c0c2236ddf183fb26c4b315a2e5704480ad4a70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
generated by cgit v1.2.3 (git 2.25.1) at 2025-03-12 07:14:43 +0000
 


onvert from big endian to little endian */
#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, tbits, b_pos)
#else
	/* convert from little endian to big endian */ 
#define SQUASHFS_SWAP(value, p, pos, tbits) _SQUASHFS_SWAP(value, p, pos, tbits, 64 - tbits - b_pos)
#endif

#define _SQUASHFS_SWAP(value, p, pos, tbits, SHIFT) {\
	int bits;\
	int b_pos = pos % 8;\
	unsigned long long val = (long long) value << (SHIFT);\
	unsigned char *s = ((unsigned char *) &val) + 7;\
	unsigned char *d = ((unsigned char *)p) + (pos / 8);\
	for(bits = 0; bits < (tbits + b_pos); bits += 8) \
		*d++ |= *s--;\
}
#define SQUASHFS_MEMSET(s, d, n)	memset(d, 0, n);