]> git.ipfire.org Git - thirdparty/freeradius-server.git/log
thirdparty/freeradius-server.git
5 months agothis should be static
Alan T. DeKok [Thu, 25 Dec 2025 16:13:17 +0000 (11:13 -0500)] 
this should be static

5 months agocomment out migration options.
Alan T. DeKok [Thu, 25 Dec 2025 16:10:40 +0000 (11:10 -0500)] 
comment out migration options.

-S foo is now ignored.  It should be removed before the official
release.

5 months agothis should be static
Alan T. DeKok [Thu, 25 Dec 2025 16:05:07 +0000 (11:05 -0500)] 
this should be static

5 months agoremove redundant ';' when using slab macros
Alan T. DeKok [Thu, 25 Dec 2025 16:01:17 +0000 (11:01 -0500)] 
remove redundant ';' when using slab macros

5 months agocast to avoid -Wcomma warning
Alan T. DeKok [Thu, 25 Dec 2025 15:55:39 +0000 (10:55 -0500)] 
cast to avoid -Wcomma warning

5 months agocasts and tweaks to avoid -Wpedantic
Alan T. DeKok [Thu, 25 Dec 2025 15:53:41 +0000 (10:53 -0500)] 
casts and tweaks to avoid -Wpedantic

5 months agothis definition can be static
Alan T. DeKok [Thu, 25 Dec 2025 15:43:12 +0000 (10:43 -0500)] 
this definition can be static

5 months agoclean up and clarify namespace issues
Alan T. DeKok [Thu, 25 Dec 2025 15:35:38 +0000 (10:35 -0500)] 
clean up and clarify namespace issues

both for structural attribute to child , and for groups of

protocol/internal -> internal/protocol

in preparation for supporting "flat" attributes in some groups

5 months agoensure that variable is initialized
Alan T. DeKok [Thu, 25 Dec 2025 15:12:51 +0000 (10:12 -0500)] 
ensure that variable is initialized

5 months agolimit the "name2" for update sections in modules
Alan T. DeKok [Thu, 25 Dec 2025 13:05:04 +0000 (08:05 -0500)] 
limit the "name2" for update sections in modules

since we no longer support full-featured "update" sections, there
is no point in supporting full paths (outer, parent, etc.) in
update sections.  Plus, none of the modules use them.

So rather than either confusing the admin, or allowing them to do
something which might not work, we just return a compile-time
error.

The deleted code was also the only code (other then tests) that
called tmpl_request_ref_list_afrom_substr().  This cleanup will
allow us to fix the tmpl code for ""flat" groups

5 months agoupdate sections don't take a second name
Alan T. DeKok [Thu, 25 Dec 2025 12:36:07 +0000 (07:36 -0500)] 
update sections don't take a second name

5 months agomissed in previous commit
Alan T. DeKok [Thu, 25 Dec 2025 12:30:22 +0000 (07:30 -0500)] 
missed in previous commit

5 months agohoist "is attribute request/reply/control/" checks to common function
Alan T. DeKok [Wed, 24 Dec 2025 16:17:10 +0000 (11:17 -0500)] 
hoist "is attribute request/reply/control/" checks to common function

5 months agothis variable can be made static
Alan T. DeKok [Wed, 24 Dec 2025 16:07:44 +0000 (11:07 -0500)] 
this variable can be made static

5 months agolimit request qualifier parsing.
Alan T. DeKok [Tue, 23 Dec 2025 19:30:16 +0000 (20:30 +0100)] 
limit request qualifier parsing.

don't allow "current", as it doesn't make sense for people to
specify it.  The default is always current.

Don't allow "outer.parent" or "parent.outer".  Those don't make
sense, either.

5 months agomore cleanups to tmpl_attr_afrom_substr()
Alan T. DeKok [Tue, 23 Dec 2025 18:22:20 +0000 (19:22 +0100)] 
more cleanups to tmpl_attr_afrom_substr()

5 months agominor tweaks to tmpl_afrom_attr_substr()
Alan T. DeKok [Tue, 23 Dec 2025 10:58:55 +0000 (11:58 +0100)] 
minor tweaks to tmpl_afrom_attr_substr()

and disallow raw local attributes

5 months agomore tests and tweaks for parsing attributes in value-boxes
Alan T. DeKok [Fri, 19 Dec 2025 14:53:37 +0000 (15:53 +0100)] 
more tests and tweaks for parsing attributes in value-boxes

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/cbor.tar
github-actions[bot] [Sat, 20 Dec 2025 04:32:52 +0000 (04:32 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/cbor.tar

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/der.tar
github-actions[bot] [Sat, 20 Dec 2025 04:31:49 +0000 (04:31 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/der.tar

5 months agoDocument %ip.v4.netmask() and %ip.v4.broadcast()
Nick Porter [Fri, 19 Dec 2025 15:58:28 +0000 (15:58 +0000)] 
Document %ip.v4.netmask() and %ip.v4.broadcast()

5 months agolimit unknown depth, and be more careful about error returns
Alan T. DeKok [Fri, 19 Dec 2025 08:16:12 +0000 (09:16 +0100)] 
limit unknown depth, and be more careful about error returns

tweak value-box type "attr" parsing to catch more cases.

5 months agoallow cast to 'attribute' from 'string'
Alan T. DeKok [Fri, 19 Dec 2025 07:20:19 +0000 (08:20 +0100)] 
allow cast to 'attribute' from 'string'

update the test framework to set the correct enumvs, and add tests

5 months agotweak "cast to same type" to not do bad things
Alan T. DeKok [Thu, 18 Dec 2025 16:57:24 +0000 (17:57 +0100)] 
tweak "cast to same type" to not do bad things

if no enumv is passed in, it shouldn't forcibly nuke the input
enumv.  This patch makes it easier to deal with FR_TYPE_ATTR

5 months agochange "oid" data type from "string" to "attr"
Alan T. DeKok [Wed, 17 Dec 2025 10:06:19 +0000 (11:06 +0100)] 
change "oid" data type from "string" to "attr"

also enforce more limits on OID values and depth.

5 months agoallow enumv to point to a new root for FR_TYPE_ATTR
Alan T. DeKok [Wed, 17 Dec 2025 08:00:39 +0000 (09:00 +0100)] 
allow enumv to point to a new root for FR_TYPE_ATTR

normally the enumv points to the dictionary root.  Instead, we
allow the enumv to point to a different part of the tree.

5 months agouse single quotes, which makes the output easier to read
Alan T. DeKok [Thu, 18 Dec 2025 16:05:52 +0000 (17:05 +0100)] 
use single quotes, which makes the output easier to read

5 months agoAdd test of !~ for rlm_files conditions
Nick Porter [Thu, 18 Dec 2025 17:19:23 +0000 (17:19 +0000)] 
Add test of !~ for rlm_files conditions

5 months agolook up name before number
Alan T. DeKok [Wed, 17 Dec 2025 16:44:44 +0000 (17:44 +0100)] 
look up name before number

names are more common than numbers, among other things.

5 months agotweak message and push error string
Alan T. DeKok [Wed, 17 Dec 2025 09:43:39 +0000 (10:43 +0100)] 
tweak message and push error string

so that we get more / better errors

5 months agodifferentiate "number too large" from "unknown child"
Alan T. DeKok [Wed, 17 Dec 2025 09:41:50 +0000 (10:41 +0100)] 
differentiate "number too large" from "unknown child"

5 months agoRFC 5280 says that OIDs can be up to 2^28
Alan T. DeKok [Wed, 17 Dec 2025 08:25:56 +0000 (09:25 +0100)] 
RFC 5280 says that OIDs can be up to 2^28

so we enforce that

5 months agoadd access descriptors
Alan T. DeKok [Wed, 17 Dec 2025 08:21:43 +0000 (09:21 +0100)] 
add access descriptors

5 months agoparse partially known and partially unknown attributes
Alan T. DeKok [Thu, 18 Dec 2025 07:44:27 +0000 (08:44 +0100)] 
parse partially known and partially unknown attributes

and commit more pair tests

5 months agoignore zero-length attributes
Alan T. DeKok [Tue, 16 Dec 2025 17:50:49 +0000 (18:50 +0100)] 
ignore zero-length attributes

5 months agothere's no need to make this "const"
Alan T. DeKok [Tue, 16 Dec 2025 17:45:03 +0000 (18:45 +0100)] 
there's no need to make this "const"

5 months agoremove unused includes
Alan T. DeKok [Tue, 16 Dec 2025 08:30:28 +0000 (09:30 +0100)] 
remove unused includes

5 months agoRemove unnecessary section binding
Nick Porter [Tue, 16 Dec 2025 13:57:29 +0000 (13:57 +0000)] 
Remove unnecessary section binding

5 months agoSection names are case sensitive
Nick Porter [Tue, 16 Dec 2025 13:56:55 +0000 (13:56 +0000)] 
Section names are case sensitive

5 months agoUse platform specific lib extension
Nick Porter [Tue, 16 Dec 2025 13:43:57 +0000 (13:43 +0000)] 
Use platform specific lib extension

5 months agoCorrect handling of nested attributes when reading detail files
Nick Porter [Tue, 16 Dec 2025 08:26:56 +0000 (08:26 +0000)] 
Correct handling of nested attributes when reading detail files

5 months agoOnly log protocol attributes when sending from rlm_radius
Nick Porter [Mon, 15 Dec 2025 18:05:02 +0000 (18:05 +0000)] 
Only log protocol attributes when sending from rlm_radius

5 months agoUse correct ifdef
Nick Porter [Mon, 15 Dec 2025 17:09:42 +0000 (17:09 +0000)] 
Use correct ifdef

5 months agofeat: Added the `flags` parameter to allow for flags to be passed to open(2).
ethan-thompson [Mon, 15 Dec 2025 15:47:05 +0000 (15:47 +0000)] 
feat: Added the `flags` parameter to allow for flags to be passed to open(2).

Signed-off-by: ethan-thompson <ethan.thompson@networkradius.com>
5 months agoWe probably don't care about the alignment of request_number
Arran Cudbard-Bell [Mon, 15 Dec 2025 12:59:30 +0000 (12:59 +0000)] 
We probably don't care about the alignment of request_number

5 months agoBump libbacktrace
Arran Cudbard-Bell [Mon, 15 Dec 2025 12:28:17 +0000 (12:28 +0000)] 
Bump libbacktrace

5 months agoIgnore default-const-init-field-unsafe
Arran Cudbard-Bell [Sun, 14 Dec 2025 15:01:08 +0000 (15:01 +0000)] 
Ignore default-const-init-field-unsafe

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/dhcpv6.tar
github-actions[bot] [Mon, 15 Dec 2025 04:43:28 +0000 (04:43 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/dhcpv6.tar

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/dns.tar
github-actions[bot] [Mon, 15 Dec 2025 04:42:58 +0000 (04:42 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/dns.tar

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/radius.tar
github-actions[bot] [Mon, 15 Dec 2025 04:42:49 +0000 (04:42 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/radius.tar

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/bfd.tar
github-actions[bot] [Mon, 15 Dec 2025 04:42:07 +0000 (04:42 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/bfd.tar

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/dhcpv4.tar
github-actions[bot] [Mon, 15 Dec 2025 04:37:22 +0000 (04:37 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/dhcpv4.tar

5 months agomake output look more like gdb
Alan T. DeKok [Sun, 14 Dec 2025 21:32:42 +0000 (16:32 -0500)] 
make output look more like gdb

5 months agohandle magic OOM values. CID #1676084
Alan T. DeKok [Sun, 14 Dec 2025 21:19:33 +0000 (16:19 -0500)] 
handle magic OOM values. CID #1676084

5 months agoget DSYM for local libs, too
Alan T. DeKok [Sun, 14 Dec 2025 16:31:36 +0000 (11:31 -0500)] 
get DSYM for local libs, too

5 months agoclean up OSX and DSYMUTIL rules so that they work
Alan T. DeKok [Sun, 14 Dec 2025 16:02:24 +0000 (11:02 -0500)] 
clean up OSX and DSYMUTIL rules so that they work

for now, we just define "DSYMTUL=touch" on platforms which don't
have it.  There isn't enough time right now to fight with GNU make
and inline "if" checks in evaluated rules

5 months agorun macro, not binary name
Alan T. DeKok [Sun, 14 Dec 2025 15:47:11 +0000 (10:47 -0500)] 
run macro, not binary name

5 months agofix typo
Alan T. DeKok [Sun, 14 Dec 2025 15:45:05 +0000 (10:45 -0500)] 
fix typo

5 months agoadd missing dependency
Alan T. DeKok [Sun, 14 Dec 2025 14:19:40 +0000 (09:19 -0500)] 
add missing dependency

so that the library builds

5 months agocreate the soft link which we need
Alan T. DeKok [Sun, 14 Dec 2025 14:17:12 +0000 (09:17 -0500)] 
create the soft link which we need

5 months ago"VERBOSE=1 make" does NOT mean "give us thousands of lines of garbage"
Alan T. DeKok [Sun, 14 Dec 2025 14:01:39 +0000 (09:01 -0500)] 
"VERBOSE=1 make" does NOT mean "give us thousands of lines of garbage"

We want to see the commands that "make" is running.  We do NOT want
to see thousands of lines of the same output from jlibtool about
its build flags.

5 months agothis should be static
Alan T. DeKok [Sun, 14 Dec 2025 13:51:01 +0000 (08:51 -0500)] 
this should be static

5 months agoRevert "unstall libunwind-dev for the fuzzers"
Alan T. DeKok [Sun, 14 Dec 2025 13:42:32 +0000 (08:42 -0500)] 
Revert "unstall libunwind-dev for the fuzzers"

This reverts commit c62e5faa586edc0e0d70ace6ea0a02ed469e3766.

this doesn't work.  We should be using libbacktrace instead.

5 months agodisable encoder tests again
Alan T. DeKok [Sun, 14 Dec 2025 13:14:23 +0000 (08:14 -0500)] 
disable encoder tests again

they're still showing random failures in CI.  It's difficult to
track down the issues when CI stubbornly refuses to show useful
stack traces, and we can't reproduce the issues locally.

5 months agoadd macro to verify list with ctx
Alan T. DeKok [Sun, 14 Dec 2025 13:06:12 +0000 (08:06 -0500)] 
add macro to verify list with ctx

5 months agoverify the destination pair, not just its children
Alan T. DeKok [Sun, 14 Dec 2025 13:11:29 +0000 (08:11 -0500)] 
verify the destination pair, not just its children

the change allows the children to be verified for their talloc
ctx, too

5 months agoremove old comment
Alan T. DeKok [Sun, 14 Dec 2025 13:02:39 +0000 (08:02 -0500)] 
remove old comment

5 months agoensure that the value-box type matches the DA type
Alan T. DeKok [Sun, 14 Dec 2025 12:31:59 +0000 (07:31 -0500)] 
ensure that the value-box type matches the DA type

5 months agoreturn negative on error
Alan T. DeKok [Sun, 14 Dec 2025 12:30:08 +0000 (07:30 -0500)] 
return negative on error

5 months agotreq may be NULL
Alan T. DeKok [Sat, 13 Dec 2025 21:13:14 +0000 (16:13 -0500)] 
treq may be NULL

if the retry timer hits before the worker thread decides that the
request is runnable again

5 months agoRevert "cancel retries on failure"
Alan T. DeKok [Sat, 13 Dec 2025 21:10:46 +0000 (16:10 -0500)] 
Revert "cancel retries on failure"

This reverts commit 07d2b3c44030462f4ff3d28522e95ed169061848.

Nope.  the frame->retry is only for the "retry" keyword.
module.c and xlat.c do their own retries, and allocate their own
timers.

5 months agodon't mangle type to octets if the DA is already unknown
Alan T. DeKok [Sat, 13 Dec 2025 20:56:53 +0000 (15:56 -0500)] 
don't mangle type to octets if the DA is already unknown

5 months ago"decode 0 extra bytes" is valid
Alan T. DeKok [Sat, 13 Dec 2025 20:56:14 +0000 (15:56 -0500)] 
"decode 0 extra bytes" is valid

e.g. integers which have value <24, or zero-length octets

5 months agodo more cleanups on error
Alan T. DeKok [Sat, 13 Dec 2025 20:55:40 +0000 (15:55 -0500)] 
do more cleanups on error

not hugely important, but useful

5 months agocancel retries on failure
Alan T. DeKok [Sat, 13 Dec 2025 19:48:38 +0000 (14:48 -0500)] 
cancel retries on failure

5 months agoadd API to cancel any pending retry
Alan T. DeKok [Sat, 13 Dec 2025 19:47:27 +0000 (14:47 -0500)] 
add API to cancel any pending retry

5 months agoinitialize variables
Alan T. DeKok [Sat, 13 Dec 2025 19:46:58 +0000 (14:46 -0500)] 
initialize variables

5 months agofree any retry handler if the frame is cancelled
Alan T. DeKok [Sat, 13 Dec 2025 19:27:49 +0000 (14:27 -0500)] 
free any retry handler if the frame is cancelled

5 months agoMissing brackets around assignment
Arran Cudbard-Bell [Sat, 13 Dec 2025 18:52:49 +0000 (18:52 +0000)] 
Missing brackets around assignment

If the submodule failed to load, we'd SEGV

5 months agolimit decode depth, as is done with the other protocols
Alan T. DeKok [Sat, 13 Dec 2025 13:26:27 +0000 (08:26 -0500)] 
limit decode depth, as is done with the other protocols

5 months ago"encode no data" is allowed
Alan T. DeKok [Sat, 13 Dec 2025 12:37:18 +0000 (07:37 -0500)] 
"encode no data" is allowed

5 months agodon't complain about "-sql" when the module isn't defined
Alan T. DeKok [Fri, 12 Dec 2025 20:58:57 +0000 (15:58 -0500)] 
don't complain about "-sql" when the module isn't defined

this cleans up the debug output and makes it easier to read.

5 months agodocs-v4: REorg the tutorials sections and add landing pages for each subsection....
nolade [Tue, 9 Dec 2025 23:48:02 +0000 (18:48 -0500)] 
docs-v4: REorg the tutorials sections and add landing pages for each subsection. HIVE 4114

5 months agoverify the list before returning it to the caller
Alan T. DeKok [Fri, 12 Dec 2025 18:52:01 +0000 (13:52 -0500)] 
verify the list before returning it to the caller

5 months agoRevert "disable encoder until we can track down a fuzzer issue"
Alan T. DeKok [Fri, 12 Dec 2025 17:40:35 +0000 (12:40 -0500)] 
Revert "disable encoder until we can track down a fuzzer issue"

This reverts commit fc7c2a07bc6910b4aba4b556181100bbcd00e15e.

5 months agounstall libunwind-dev for the fuzzers
Alan T. DeKok [Fri, 12 Dec 2025 16:59:26 +0000 (11:59 -0500)] 
unstall libunwind-dev for the fuzzers

5 months agoonly update LDFLAGS if the configure checks pass
Alan T. DeKok [Fri, 12 Dec 2025 16:33:49 +0000 (11:33 -0500)] 
only update LDFLAGS if the configure checks pass

5 months agoremove unused file
Alan T. DeKok [Fri, 12 Dec 2025 14:53:31 +0000 (09:53 -0500)] 
remove unused file

5 months agodisable encoder until we can track down a fuzzer issue
Alan T. DeKok [Fri, 12 Dec 2025 12:42:41 +0000 (07:42 -0500)] 
disable encoder until we can track down a fuzzer issue

it's preventing the pair_legacy changes from being merged

5 months agoRewrite fr_pair_list_afrom_substr()
Alan T. DeKok [Thu, 11 Dec 2025 01:41:07 +0000 (20:41 -0500)] 
Rewrite fr_pair_list_afrom_substr()

and update tests to match.

It now properly handles aliases, groups, etc.  The parsing has
been significantly re-worked.  All of the old-style strings should
still be allowed, except for ones which had never made sense.

And since aliases, groups, etc. are now handled properly, the
fr_pair_t parenting is also correct.  So we can start enabling the
checks on parenting.

Which should help us remove the last vestiges of "flat" attributes

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/util.tar
github-actions[bot] [Fri, 12 Dec 2025 04:37:58 +0000 (04:37 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/util.tar

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/tftp.tar
github-actions[bot] [Fri, 12 Dec 2025 04:37:55 +0000 (04:37 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/tftp.tar

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/vmps.tar
github-actions[bot] [Fri, 12 Dec 2025 04:37:19 +0000 (04:37 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/vmps.tar

5 months agoScheduled fuzzing: Update src/tests/fuzzer-corpus/tacacs.tar
github-actions[bot] [Fri, 12 Dec 2025 04:37:17 +0000 (04:37 +0000)] 
Scheduled fuzzing: Update src/tests/fuzzer-corpus/tacacs.tar

6 months agomove WiMAX examples to the WiMAX module.
Alan T. DeKok [Thu, 11 Dec 2025 01:28:32 +0000 (20:28 -0500)] 
move WiMAX examples to the WiMAX module.

WiMAX is largely dead, so it does not need to appear in the default
configuration.

6 months agoenable encoder in fuzzers
Alan T. DeKok [Wed, 10 Dec 2025 04:14:25 +0000 (23:14 -0500)] 
enable encoder in fuzzers

now that we've fixed many (most?) issues with the code, we can
start to automatically test the encoders.

Instead of having a separate fuzzer test for the encoders, we just
use the fuzzer input to decode attributes, and then call the encoder
with the attributes we just found.  This should be a reasonable
test of all kinds of odd behavior

6 months agomanually switch to local / openssl versions of MD4 and MD5.
Alan T. DeKok [Wed, 10 Dec 2025 19:21:52 +0000 (14:21 -0500)] 
manually switch to local / openssl versions of MD4 and MD5.

The fuzzer doesn't call all of the OpenSSL initialization functions,
so if it calls any MD5 routines in RADIUS, it crashes.  If we try to
call fr_openssl_fips_mode(), we need to link to libfreeradius-tls,
libfreeradius-server, libfreeradius-unlang, and then call
fr_openssl_init(), which does a ton of other things.

The solution is to manually swap the functions to their local
versions, OR the OpenSSL versions.  This is done in fr_openssl_init()
and in fr_openssl_free().  And for good measure, in then also in
fr_openssl_fips_mode().

The previous code could boot with FIPS disabled, set the MD5
pointers, and then at some later point FIPS would be disabled.
The MD5 pointers wouldn't be updated, and bad things could happen.

That case deosn't happen now, because the current code only changes
the FIPs status once at boot.  But it's better to fix the APIs to
be more correct.

6 months agoreturn the expected value
Alan T. DeKok [Wed, 10 Dec 2025 18:36:08 +0000 (13:36 -0500)] 
return the expected value

not the incorrect value we found from the network data

6 months agoupdate fr_pair_verify() with argument to verify the values
Alan T. DeKok [Wed, 10 Dec 2025 15:10:32 +0000 (10:10 -0500)] 
update fr_pair_verify() with argument to verify the values

so that we can check more often for invalid values.  The default
is "true" for the PAIR_VERIFY() and REQUEST_VERIFY() macros.

Update the various parsers to pass "false" if they add a VP to a
list before setting the value.  This lets the tests continue to
pass, but also ensures that at normal run-time, we do the full
checks.

6 months agostring / octets can have length=0 and no pointer
Alan T. DeKok [Wed, 10 Dec 2025 14:42:07 +0000 (09:42 -0500)] 
string / octets can have length=0 and no pointer

in which case there isn't a need for the actual data.  The printing
and encoding routines already ignore the pointer when length=i=0

But we may want to re-visit that decision.

Also add a commented-out assertion that the pointer is NULL when
length==0.  This could perhaps be relaxed to check that the pointer
points to a NUL byte (string), or is a zero-length memory region
(octets)