mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-01 21:00:19 +00:00
[MEM] valgrind memcheck findings (#3349)
The proposal out of the valgrind memcheck procedure are a couple of small patches to open5gs within the patches subdirectory.
This commit is contained in:
parent
9828509668
commit
c5025ec64c
3 changed files with 38 additions and 11 deletions
|
|
@ -327,12 +327,18 @@ void zuc_eea3(u8* CK, u32 COUNT, u32 BEARER, u32 DIRECTION,
|
|||
C[i] = M[i] ^ ((z[i/4] >> (3-i%4)*8) & 0xff);
|
||||
}
|
||||
|
||||
/*
|
||||
* Issues #3349
|
||||
* Valgrind memcheck: Invalid read & write: Add {}.
|
||||
*/
|
||||
|
||||
/* zero last bits of data in case its length is not word-aligned (32 bits)
|
||||
this is an addition to the C reference code, which did not handle it */
|
||||
if (lastbits)
|
||||
if (lastbits) {
|
||||
i--;
|
||||
C[i] &= 0x100 - (1<<lastbits);
|
||||
|
||||
}
|
||||
|
||||
ogs_free(z);
|
||||
}
|
||||
/* end of EEA3.c */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue