Skip to content

Commit

Permalink
Fix sys-stat.c where a pointer to a mode_t (potentially an int16) was…
Browse files Browse the repository at this point in the history
… being unsafely converted to an int32 pointer
  • Loading branch information
xmcclure committed Nov 23, 2015
1 parent a425ee9 commit f4744df
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion support/sys-stat.c
Expand Up @@ -30,9 +30,13 @@ Mono_Posix_FromStat (struct Mono_Posix_Stat *from, void *_to)

to->st_dev = from->st_dev;
to->st_ino = from->st_ino;
if (Mono_Posix_FromFilePermissions (from->st_mode, &to->st_mode) != 0) {

unsigned int to_st_mode;
if (Mono_Posix_FromFilePermissions (from->st_mode, &to_st_mode) != 0) {
return -1;
}

to->st_mode = to_st_mode;
to->st_nlink = from->st_nlink;
to->st_uid = from->st_uid;
to->st_gid = from->st_gid;
Expand Down

0 comments on commit f4744df

Please sign in to comment.