]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Get rid of superfluous test in loop in command_encode_dns_label (#4463)
authorJames Jones <jejones3141@gmail.com>
Fri, 22 Apr 2022 20:23:51 +0000 (15:23 -0500)
committerGitHub <noreply@github.com>
Fri, 22 Apr 2022 20:23:51 +0000 (16:23 -0400)
By virtue of CC_HINT(nonnull), in, and hence p, will be non-NULL
the first time through the loop. To take another iteration, next
must be non-NULL, so that p, set to next + 1, will also be non-NULL;
hence the "while (p)" is effectively "while (true)".

src/bin/unit_test_attribute.c

index b0f0ee887975d076f53cd963c8f042619f5c6210..dad289c5ff3265be5c4f6bfca2caf6112e4263ff 100644 (file)
@@ -1745,7 +1745,7 @@ size_t command_encode_dns_label(command_result_t *result, command_file_ctx_t *cc
 
        enc_p = cc->buffer_start;
 
-       while (p) {
+       while (true) {
                fr_value_box_t *box = talloc_zero(NULL, fr_value_box_t);
 
                fr_skip_whitespace(p);