From: Arran Cudbard-Bell Date: Thu, 3 Feb 2022 16:05:44 +0000 (-0500) Subject: Don't need to do work if pad_len is the same length as the thing being padded X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7825a5904555b781dcb8f4d6b3b5266ac2b0ca31;p=thirdparty%2Ffreeradius-server.git Don't need to do work if pad_len is the same length as the thing being padded --- diff --git a/src/lib/unlang/xlat_builtin.c b/src/lib/unlang/xlat_builtin.c index c54f5fdb4d2..261e32a933e 100644 --- a/src/lib/unlang/xlat_builtin.c +++ b/src/lib/unlang/xlat_builtin.c @@ -1684,7 +1684,7 @@ static xlat_action_t xlat_func_lpad(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, fr_dcursor_append(out, in); - if (len > pad_len) continue; + if (len >= pad_len) continue; if (fr_value_box_bstr_realloc(in, &buff, in, pad_len) < 0) { RPEDEBUG("Failed reallocing input data"); @@ -1764,7 +1764,7 @@ static xlat_action_t xlat_func_rpad(UNUSED TALLOC_CTX *ctx, fr_dcursor_t *out, fr_dcursor_append(out, in); - if (len > pad_len) continue; + if (len >= pad_len) continue; if (fr_value_box_bstr_realloc(in, &buff, in, pad_len) < 0) { RPEDEBUG("Failed reallocing input data");