Skip to content

Commit

Permalink
Restrict-qualify stat_multiarch
Browse files Browse the repository at this point in the history
  • Loading branch information
AreaZR authored and millert committed Aug 13, 2024
1 parent 7269ee2 commit e7483ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/sudo_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ sudo_dso_public int sudo_mmap_protect_v1(void *ptr);
#define sudo_mmap_protect(_a) sudo_mmap_protect_v1(_a)

/* multiarch.c */
sudo_dso_public char *sudo_stat_multiarch_v1(const char *path, struct stat *sb);
sudo_dso_public char *sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb);
#define sudo_stat_multiarch(_a, _b) sudo_stat_multiarch_v1((_a), (_b))

/* parseln.c */
Expand Down
4 changes: 2 additions & 2 deletions lib/util/multiarch.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* Returns a dynamically allocated string on success and NULL on failure.
*/
char *
sudo_stat_multiarch_v1(const char *path, struct stat *sb)
sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb)
{
# if defined(__ILP32__)
const char *libdirs[] = { "/libx32/", "/lib/", "/libexec/", NULL };
Expand Down Expand Up @@ -96,7 +96,7 @@ sudo_stat_multiarch_v1(const char *path, struct stat *sb)
}
#else
char *
sudo_stat_multiarch_v1(const char *path, struct stat *sb)
sudo_stat_multiarch_v1(const char * restrict path, struct stat * restrict sb)
{
return NULL;
}
Expand Down

0 comments on commit e7483ae

Please sign in to comment.