summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2024-03-14 16:44:34 +0100
committerPhil Sutter <phil@nwl.cc>2024-04-11 01:27:07 +0200
commita113d1ffb6405407d98430807f3534e64a71837e (patch)
tree54edb3527aaafe54aac97276be8c9b51acbaa22c /src
parent08c9cab3352402c1a7d7952d1a2ce0a051f48b14 (diff)
obj: Do not call nftnl_obj_set_data() with zero data_len
Pass 'strlen() + 1' as length parameter when setting string attributes, just like other string setters do. Fixes: 5573d0146c1ae ("src: support for stateful objects") Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'src')
-rw-r--r--src/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/object.c b/src/object.c
index d3bfd16..b518a67 100644
--- a/src/object.c
+++ b/src/object.c
@@ -185,7 +185,7 @@ void nftnl_obj_set_u64(struct nftnl_obj *obj, uint16_t attr, uint64_t val)
EXPORT_SYMBOL(nftnl_obj_set_str);
void nftnl_obj_set_str(struct nftnl_obj *obj, uint16_t attr, const char *str)
{
- nftnl_obj_set_data(obj, attr, str, 0);
+ nftnl_obj_set_data(obj, attr, str, strlen(str) + 1);
}
EXPORT_SYMBOL(nftnl_obj_get_data);