From: Arran Cudbard-Bell Date: Thu, 17 Nov 2022 18:04:52 +0000 (-0600) Subject: Quiet ubsan X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c10584f12aabc165af7f7d4600af4ed89be70272;p=thirdparty%2Ffreeradius-server.git Quiet ubsan --- diff --git a/src/lib/unlang/xlat_eval.c b/src/lib/unlang/xlat_eval.c index 3c61aee9630..23189436c6f 100644 --- a/src/lib/unlang/xlat_eval.c +++ b/src/lib/unlang/xlat_eval.c @@ -501,7 +501,7 @@ xlat_action_t xlat_process_args(TALLOC_CTX *ctx, FR_DLIST_HEAD(fr_value_box_list * - true - If return values were correct. * - false - If the return values were incorrect. */ -static inline CC_HINT(nonnull) +static inline CC_HINT(nonnull(1,2,3)) bool xlat_process_return(request_t *request, xlat_t const *func, FR_DLIST_HEAD(fr_value_box_list) const *returned, fr_value_box_t *pos) { unsigned int count = 0; @@ -510,7 +510,7 @@ bool xlat_process_return(request_t *request, xlat_t const *func, FR_DLIST_HEAD(f * Nothing to validate. We don't yet enforce that functions * must return at least one instance of their type. */ - if (!fr_value_box_list_num_elements(returned) || fr_type_is_void(func->return_type)) return true; + if (!pos | fr_type_is_void(func->return_type)) return true; if (fr_type_is_null(func->return_type)) { /* Dynamic expansion to get the right name */