** CID
1575504: Insecure data handling (TAINTED_SCALAR) (maybe)
** CID
1575505: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
** CID
1575506: Integer handling issues (CONSTANT_EXPRESSION_RESULT)
** CID
1575507: Null pointer dereferences (REVERSE_INULL)
Signed-off-by: Christian Hopps <chopps@labn.net>
*/
#define darr_ensure_i_mt(A, I, MT) \
({ \
- assert((int)(I) >= 0 && (int)(I) <= INT_MAX); \
+ assert((int)(I) >= 0 && (uint)(I) <= INT_MAX); \
int _i = (int)(I); \
if (_i > darr_maxi(A)) \
_darr_resize_mt((A), _i + 1, MT); \
}
darr_free(remove);
- if (set)
- ly_set_free(set, NULL);
+ ly_set_free(set, NULL);
return LY_SUCCESS;
#endif
uint8_t *buf = NULL;
int ret = 0;
- darr_append_n(buf, offsetof(typeof(*msg), result));
+ darr_append_n(buf, sizeof(*msg));
msg = (typeof(msg))buf;
msg->refer_id = session->session_id;
msg->req_id = req_id;