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
diff --git a/src/conv.c b/src/conv.c
index a2c13de..06c4299 100644
--- a/src/conv.c
+++ b/src/conv.c
@@ -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 @@
const struct osmo_conv_code *code)
{
memset(encoder, 0x00, sizeof(struct osmo_conv_encoder));
+ OSMO_ASSERT(code != NULL);
encoder->code = code;
}