{
int compare = 0;
- if (!a || !b) return -1;
-
if (!fr_cond_assert(a->type != FR_TYPE_NULL)) return -1;
if (!fr_cond_assert(b->type != FR_TYPE_NULL)) return -1;
* - -1 on failure.
*/
int fr_value_box_bstr_alloc(TALLOC_CTX *ctx, char **out, fr_value_box_t *dst, fr_dict_attr_t const *enumv,
- size_t len, bool tainted)
+ size_t len, bool tainted)
{
char *str;
fr_dlist_t entry;
- if (!list || fr_dlist_empty(list)) {
- fr_strerror_const("Invalid arguments. List was NULL");
+ if (fr_dlist_empty(list)) {
+ fr_strerror_const("Invalid arguments. List contains no elements");
return -1;
}
* i.e. we want to merge all its siblings
* into it.
*/
- if (!out || (out == head_vb)) {
+ if (out == head_vb) {
out = head_vb; /* sync up out and head_vb */
switch (type) {
*/
void value_box_verify(char const *file, int line, fr_value_box_t const *vb, bool talloced)
{
+DIAG_OFF(nonnull-compare)
+ /*
+ * nonnull only does something if we're building
+ * with ubsan... We still want to assert event
+ * if we're building without sanitizers.
+ */
fr_fatal_assert_msg(vb, "CONSISTENCY CHECK FAILED %s[%i]: fr_value_box_t pointer was NULL", file, line);
+DIAG_ON(nonnull-compare)
if (talloced) vb = talloc_get_type_abort_const(vb, fr_value_box_t);
*/
int fr_value_box_bstr_alloc(TALLOC_CTX *ctx, char **out, fr_value_box_t *dst, fr_dict_attr_t const *enumv,
size_t len, bool tainted)
- CC_HINT(nonnull(2,3));
+ CC_HINT(nonnull(3));
int fr_value_box_bstr_realloc(TALLOC_CTX *ctx, char **out, fr_value_box_t *dst, size_t len)
CC_HINT(nonnull(3));
*/
int fr_value_box_mem_alloc(TALLOC_CTX *ctx, uint8_t **out, fr_value_box_t *dst, fr_dict_attr_t const *enumv,
size_t len, bool tainted)
- CC_HINT(nonnull(2,3));
+ CC_HINT(nonnull(3));
int fr_value_box_mem_realloc(TALLOC_CTX *ctx, uint8_t **out, fr_value_box_t *dst, size_t len)
CC_HINT(nonnull(3));