summaryrefslogtreecommitdiffstats
path: root/src/sord.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-07-17 17:20:54 +0200
committerDavid Robillard <d@drobilla.net>2020-07-17 17:20:54 +0200
commit8a8410f5330dccb8d213e1acdf938cc4c25003e9 (patch)
tree56d2375adb045380e8cab1dbb08d7d117df79a9f /src/sord.c
parente0d568242784d82eb8d8591860f9bba9a37c7927 (diff)
downloadsord-8a8410f5330dccb8d213e1acdf938cc4c25003e9.tar.gz
sord-8a8410f5330dccb8d213e1acdf938cc4c25003e9.tar.bz2
sord-8a8410f5330dccb8d213e1acdf938cc4c25003e9.zip
Fix potential string null termination issue
Diffstat (limited to 'src/sord.c')
-rw-r--r--src/sord.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sord.c b/src/sord.c
index 0e830b7..a8a0c63 100644
--- a/src/sord.c
+++ b/src/sord.c
@@ -1085,7 +1085,7 @@ sord_new_literal_counted(SordWorld* world,
key.meta.lit.datatype = sord_node_copy(datatype);
memset(key.meta.lit.lang, 0, sizeof(key.meta.lit.lang));
if (lang) {
- strncpy(key.meta.lit.lang, lang, sizeof(key.meta.lit.lang));
+ strncpy(key.meta.lit.lang, lang, sizeof(key.meta.lit.lang) - 1);
}
return sord_insert_node(world, &key, true);