]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
debug/readlink{, at}_chk.c: Harmonize declaration and definition
authorFrederic Berat <fberat@redhat.com>
Tue, 20 Jun 2023 18:19:03 +0000 (20:19 +0200)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 22 Jun 2023 04:21:06 +0000 (00:21 -0400)
The declaration and definition of these routines aren't consistent.

Make the definition of __readlink_chk and __readlinkat_chk match the
declaration of the routines they fortify.  While there are no problems
today this avoids any future potential problems related to the mismatch.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
debug/readlink_chk.c
debug/readlinkat_chk.c

index c491db2225e3fd09ab5361ee7a4178875f50c52f..99dea40c7bcd61a87975ba72d92e7005a4206df4 100644 (file)
@@ -24,7 +24,8 @@
 
 
 ssize_t
-__readlink_chk (const char *path, void *buf, size_t len, size_t buflen)
+__readlink_chk (const char *__restrict path, char *__restrict buf, size_t len,
+               size_t buflen)
 {
   if (len > buflen)
     __chk_fail ();
index 03feac92eca638be33c9fb53ef8348b0a9cd7d83..163dec8b80f042e580ab09e94a72dbce55c00503 100644 (file)
@@ -20,7 +20,8 @@
 
 
 ssize_t
-__readlinkat_chk (int fd, const char *path, void *buf, size_t len,
+__readlinkat_chk (int fd, const char *__restrict path,
+                 char *__restrict buf, size_t len,
                  size_t buflen)
 {
   if (len > buflen)