]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4726] Removed another sprintf master
authorFrancis Dupont <fdupont@isc.org>
Mon, 10 Aug 2026 13:11:16 +0000 (15:11 +0200)
committerFrancis Dupont <fdupont@isc.org>
Mon, 10 Aug 2026 13:28:24 +0000 (15:28 +0200)
src/lib/config/command-socket.dox

index afa6c5f393dc9b3aaf67839c564d48fd79ccc601..545635aa466b4345a3a94e563fffbc0a33a8cc6c 100644 (file)
@@ -116,7 +116,7 @@ int main(int argc, const char* argv[]) {
 
     // Send a command to list all available commands.
     char buf[1024];
 
     // Send a command to list all available commands.
     char buf[1024];
-    sprintf(buf, "{ \"command\": \"list-commands\" }");
+    snprintf(buf, sizeof(buf), "{ \"command\": \"list-commands\" }");
     int bytes_sent = send(socket_fd, buf, strlen(buf), 0);
     printf("%d bytes sent\n", bytes_sent);
 
     int bytes_sent = send(socket_fd, buf, strlen(buf), 0);
     printf("%d bytes sent\n", bytes_sent);