mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
Fix 32-bit int truncation in QED header check
* src/util/memory.c: Avoid 32-bit truncation extracting a 64bit int
This commit is contained in:
parent
227ed26614
commit
f86c7801e9
@ -437,14 +437,14 @@ qedGetHeaderUL(const unsigned char *loc)
|
||||
static unsigned long long
|
||||
qedGetHeaderULL(const unsigned char *loc)
|
||||
{
|
||||
return ( ((unsigned long)loc[7] << 56)
|
||||
| ((unsigned long)loc[6] << 48)
|
||||
| ((unsigned long)loc[5] << 40)
|
||||
| ((unsigned long)loc[4] << 32)
|
||||
| ((unsigned long)loc[3] << 24)
|
||||
| ((unsigned long)loc[2] << 16)
|
||||
| ((unsigned long)loc[1] << 8)
|
||||
| ((unsigned long)loc[0] << 0));
|
||||
return ( ((unsigned long long)loc[7] << 56)
|
||||
| ((unsigned long long)loc[6] << 48)
|
||||
| ((unsigned long long)loc[5] << 40)
|
||||
| ((unsigned long long)loc[4] << 32)
|
||||
| ((unsigned long long)loc[3] << 24)
|
||||
| ((unsigned long long)loc[2] << 16)
|
||||
| ((unsigned long long)loc[1] << 8)
|
||||
| ((unsigned long long)loc[0] << 0));
|
||||
}
|
||||
|
||||
static int
|
||||
|
Loading…
Reference in New Issue
Block a user