mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-11-01 08:58:07 +00:00
8d34458781
This adds safe versions of bch2_varint_(encode|decode) that don't read or write past the end of the buffer, or varint being encoded. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
11 lines
318 B
C
11 lines
318 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _BCACHEFS_VARINT_H
|
|
#define _BCACHEFS_VARINT_H
|
|
|
|
int bch2_varint_encode(u8 *, u64);
|
|
int bch2_varint_decode(const u8 *, const u8 *, u64 *);
|
|
|
|
int bch2_varint_encode_fast(u8 *, u64);
|
|
int bch2_varint_decode_fast(const u8 *, const u8 *, u64 *);
|
|
|
|
#endif /* _BCACHEFS_VARINT_H */
|