Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UTF-8 validation is missing on operational datastore #3173

Closed
awesomenode opened this issue Oct 3, 2023 · 1 comment
Closed

UTF-8 validation is missing on operational datastore #3173

awesomenode opened this issue Oct 3, 2023 · 1 comment
Labels
is:bug Bug description. status:completed From the developer perspective, the issue was solved (bug fixed, question answered,...)

Comments

@awesomenode
Copy link

Hi,

When pushing invalid UTF-8 string into operational datastore it gets corrupted and any further get operation will fail on the whole yang module:

$ oper_data_push_example "/ietf-system:system-state/platform/os-name" $(echo -n -e '\xff') & 

Application will set "/ietf-system:system-state/platform/os-name" to value "�". 

========== WAITING AS OWNER OF SET DATA ========== 

$ sr_get_items_example "/ietf-system:system-state/platform/os-name" operational 
Application will get "/ietf-system:system-state/platform/os-name" from "operational" datastore. 

[ERR] JSON DS file: Invalid character 0xffffffff. 
[ERR] Callback "load" of plugin "JSON DS file" for module "ietf-system" failed.
 
$ sr_get_items_example "/ietf-system:system-state/platform/os-version" operational 
Application will get "/ietf-system:system-state/platform/os-version" from "operational" datastore. 

[ERR] JSON DS file: Invalid character 0xffffffff. 
[ERR] Callback "load" of plugin "JSON DS file" for module "ietf-system" failed.

Note that in case of running datastore sr_set_item*() functions fail when trying to set invalid string.

libyang version: 2.1.123
sysrepo version: 2.2.117

Thank you in advance!

@michalvasko
Copy link
Collaborator

Okay, the string values were often not checked at all and now they should be.

@michalvasko michalvasko added is:bug Bug description. status:completed From the developer perspective, the issue was solved (bug fixed, question answered,...) labels Oct 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:bug Bug description. status:completed From the developer perspective, the issue was solved (bug fixed, question answered,...)
Projects
None yet
Development

No branches or pull requests

2 participants