Merge pull request #16210 from LabNConsulting/chopps/fix-bug

lib: fix incorrect use of error checking macro
This commit is contained in:
Jafar Al-Gharaibeh 2024-06-13 00:14:16 -05:00 committed by GitHub
commit 212a75eca9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -897,7 +897,7 @@ char *yang_convert_lyd_format(const char *data, size_t data_len,
assert(out_format != LYD_LYB);
if (in_format != LYD_LYB && !MGMT_MSG_VALIDATE_NUL_TERM(data, data_len)) {
if (in_format != LYD_LYB && (!data_len || data[data_len - 1] != 0)) {
zlog_err("Corrupt input data, no NUL terminating byte");
return NULL;
}