mirror of https://gerrit.osmocom.org/libosmocore
conv: prevent theoretical NULL pointer dereference in osmo_conv_encode()
A caller shall never pass NULL to osmo_conv_encode(). Change-Id: Ice0050cd7c7e3fcbf57c2c73682ca28843a92d8b Fixes: CID#208174
This commit is contained in:
parent
df4f6085cd
commit
a8809f0a16
|
@ -36,6 +36,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <osmocom/core/utils.h>
|
||||
#include <osmocom/core/bits.h>
|
||||
#include <osmocom/core/conv.h>
|
||||
|
||||
|
@ -87,6 +88,7 @@ osmo_conv_encode_init(struct osmo_conv_encoder *encoder,
|
|||
const struct osmo_conv_code *code)
|
||||
{
|
||||
memset(encoder, 0x00, sizeof(struct osmo_conv_encoder));
|
||||
OSMO_ASSERT(code != NULL);
|
||||
encoder->code = code;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue