diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-02 00:38:13 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-02-02 00:38:13 +0100 |
commit | 21cd3b718a2311671ef283759b6d3723fa9db232 (patch) | |
tree | 379794e8f2cde7b4ceb39f22a0b6d9b97ca66f72 /procfs | |
parent | 0cc80b3913489e74f6d5a0ac9b8a4c5523d9cecd (diff) | |
download | hurd-21cd3b718a2311671ef283759b6d3723fa9db232.tar.gz hurd-21cd3b718a2311671ef283759b6d3723fa9db232.tar.bz2 hurd-21cd3b718a2311671ef283759b6d3723fa9db232.zip |
Avoid unaligned memory accesses
Diffstat (limited to 'procfs')
-rw-r--r-- | procfs/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/procfs/main.c b/procfs/main.c index e9e29123..6200e0e4 100644 --- a/procfs/main.c +++ b/procfs/main.c @@ -270,6 +270,7 @@ root_make_node (struct ps_context *pc, struct node **np) proclist_make_node (pc), rootdir_make_node (pc), }; + uint32_t ino; *np = dircat_make_node (root_dirs, sizeof root_dirs / sizeof root_dirs[0]); if (! *np) @@ -277,7 +278,8 @@ root_make_node (struct ps_context *pc, struct node **np) /* Since this one is not created through proc_lookup(), we have to affect an inode number to it. */ - (*np)->nn_stat.st_ino = * (uint32_t *) "PROC"; + memcpy(&ino, "PROC", sizeof(ino)); + (*np)->nn_stat.st_ino = ino; return 0; } |