summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-08-23 15:55:49 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-24 00:45:03 +0200
commitcb52bfdd27f44ca1fe357120f388ac4bdf6d4f8d (patch)
treed5ac7c60b87a30f4949f53796c02a692b2bf8c11 /Userland
parent5c1a72f0ef504f6be3fdc23224060aaffddb14f5 (diff)
downloadserenity-cb52bfdd27f44ca1fe357120f388ac4bdf6d4f8d.zip
Userland: Prefer strlcpy over strcpy in ping
This is supposed to serve as a reminder if and when someone decides to make the 'msg' field configurable.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/ping.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/ping.cpp b/Userland/ping.cpp
index 54fbf343bd..9096d0e470 100644
--- a/Userland/ping.cpp
+++ b/Userland/ping.cpp
@@ -125,7 +125,7 @@ int main(int argc, char** argv)
ping_packet.header.code = 0;
ping_packet.header.un.echo.id = htons(pid);
ping_packet.header.un.echo.sequence = htons(seq++);
- strcpy(ping_packet.msg, "Hello there!\n");
+ strlcpy(ping_packet.msg, "Hello there!\n", sizeof(ping_packet.msg));
ping_packet.header.checksum = internet_checksum(&ping_packet, sizeof(PingPacket));