Commit 2bfa768
committed
tmpl, value, xlat: carry null through arg lists instead of casting it
Reverses the cast coercion added in 3b51650. An explicit `null`
should not silently become "" or zero-length octets - callers that
wrote `null` meant "no value at all", which is a different shape
from "the empty string".
value.c: fr_value_box_cast_to_{string,octets} now return a clean
fr_strerror() on FR_TYPE_NULL source instead of falling through to
the catch-all fr_assert(0).
xlat_tokenize.c: xlat_validate_function_arg skips the compile-time
cast for FR_TYPE_NULL literals so a bareword `null` survives arg
validation.
xlat_eval.c: the runtime concat and per-box cast paths both pass an
FR_TYPE_NULL source through to the xlat body unchanged, so
implementations can check fr_type_is_null() on the incoming box
and react accordingly.1 parent 998a682 commit 2bfa768
3 files changed
Lines changed: 33 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
465 | 469 | | |
466 | | - | |
| 470 | + | |
467 | 471 | | |
468 | 472 | | |
469 | 473 | | |
| |||
473 | 477 | | |
474 | 478 | | |
475 | 479 | | |
| 480 | + | |
| 481 | + | |
476 | 482 | | |
477 | 483 | | |
478 | 484 | | |
| |||
490 | 496 | | |
491 | 497 | | |
492 | 498 | | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
493 | 509 | | |
494 | 510 | | |
495 | 511 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
343 | 351 | | |
344 | 352 | | |
345 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2616 | 2616 | | |
2617 | 2617 | | |
2618 | 2618 | | |
2619 | | - | |
| 2619 | + | |
| 2620 | + | |
2620 | 2621 | | |
2621 | 2622 | | |
2622 | | - | |
| 2623 | + | |
| 2624 | + | |
2623 | 2625 | | |
2624 | 2626 | | |
2625 | 2627 | | |
| |||
2674 | 2676 | | |
2675 | 2677 | | |
2676 | 2678 | | |
2677 | | - | |
2678 | | - | |
| 2679 | + | |
| 2680 | + | |
2679 | 2681 | | |
2680 | 2682 | | |
2681 | | - | |
| 2683 | + | |
| 2684 | + | |
2682 | 2685 | | |
2683 | 2686 | | |
2684 | 2687 | | |
| |||
0 commit comments