mirror of
https://github.com/curl/curl.git
synced 2026-08-24 14:03:35 +03:00
tool/var: also error when expansion result starts with NUL
Expansions whose output starts with NUL were being expanded to the empty string, and not being recognised as values that contain a NUL byte, and should error. Closes #11694
This commit is contained in:
parent
1c3fcbdaa9
commit
70f1b540f3
3 changed files with 35 additions and 2 deletions
|
|
@ -307,7 +307,7 @@ ParameterError varexpand(struct GlobalConfig *global,
|
|||
vlen = curlx_dyn_len(&buf);
|
||||
}
|
||||
|
||||
if(value && *value) {
|
||||
if(value && vlen > 0) {
|
||||
/* A variable might contain null bytes. Such bytes cannot be shown
|
||||
using normal means, this is an error. */
|
||||
char *nb = memchr(value, '\0', vlen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue