summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-07-15 10:15:05 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-07-15 14:25:22 +0200
commit59ccaaebf616bc0be96af3b9b8c0be6828113edc (patch)
treeffe0755356488cf05799f2c844df58f63e17e62d /src/rest.c
parentd6284b613835ddd1b250688cb7fe657119490820 (diff)
rest: replace strcat with strncat in og_set_client_mode
Improve string handling security by replacing strcat with the more secure strncat.
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rest.c b/src/rest.c
index 8191648..c0e158e 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -1355,7 +1355,8 @@ static int og_set_client_mode(struct og_dbi *dbi, const char *mac,
dbi_result_next_row(result);
for (i = 1; i <= dbi_result_get_numfields(result); ++i)
- strcat(params, dbi_result_get_string_idx(result, i));
+ strncat(params, dbi_result_get_string_idx(result, i),
+ sizeof(params) - strlen(params) - 1);
dbi_result_free(result);