]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
ban strncpy()
authorAlan T. DeKok <aland@freeradius.org>
Tue, 30 Dec 2025 12:05:34 +0000 (07:05 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 30 Dec 2025 12:53:24 +0000 (07:53 -0500)
src/include/build.h

index 67158d193ad86db7f178065f0abf26a7339a646f..0fd4b3cc7dc7d53fade358b9acd302c60872728c 100644 (file)
@@ -510,3 +510,10 @@ do { \
        do { \
                _type ignored UNUSED = (_expr); \
        } while (0)
+
+/** Force a compilation error if strncpy() is used.
+ *
+ */
+extern char *dont_use_strncpy(char *dst, char const *src, size_t len);
+#undef strncpy
+#define strncpy(_dst, _src, _len) dont_use_strncpy()