diff options
Diffstat (limited to 'util-linux')
-rw-r--r-- | util-linux/mount.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/util-linux/mount.c b/util-linux/mount.c index 4392363ba..620b14667 100644 --- a/util-linux/mount.c +++ b/util-linux/mount.c | |||
@@ -1043,12 +1043,10 @@ static NOINLINE int nfsmount(struct mntent *mp, long vfsflags, char *filteropts) | |||
1043 | bb_herror_msg("%s", hostname); | 1043 | bb_herror_msg("%s", hostname); |
1044 | goto fail; | 1044 | goto fail; |
1045 | } | 1045 | } |
1046 | if ((size_t)hp->h_length > sizeof(struct in_addr)) { | 1046 | if (hp->h_length != (int)sizeof(struct in_addr)) { |
1047 | bb_error_msg("got bad hp->h_length"); | 1047 | bb_error_msg_and_die("only IPv4 is supported"); |
1048 | hp->h_length = sizeof(struct in_addr); | ||
1049 | } | 1048 | } |
1050 | memcpy(&server_addr.sin_addr, | 1049 | memcpy(&server_addr.sin_addr, hp->h_addr_list[0], sizeof(struct in_addr)); |
1051 | hp->h_addr, hp->h_length); | ||
1052 | } | 1050 | } |
1053 | 1051 | ||
1054 | memcpy(&mount_server_addr, &server_addr, sizeof(mount_server_addr)); | 1052 | memcpy(&mount_server_addr, &server_addr, sizeof(mount_server_addr)); |
@@ -1331,13 +1329,11 @@ static NOINLINE int nfsmount(struct mntent *mp, long vfsflags, char *filteropts) | |||
1331 | bb_herror_msg("%s", mounthost); | 1329 | bb_herror_msg("%s", mounthost); |
1332 | goto fail; | 1330 | goto fail; |
1333 | } | 1331 | } |
1334 | if ((size_t)hp->h_length > sizeof(struct in_addr)) { | 1332 | if (hp->h_length != (int)sizeof(struct in_addr)) { |
1335 | bb_error_msg("got bad hp->h_length"); | 1333 | bb_error_msg_and_die("only IPv4 is supported"); |
1336 | hp->h_length = sizeof(struct in_addr); | ||
1337 | } | 1334 | } |
1338 | mount_server_addr.sin_family = AF_INET; | 1335 | mount_server_addr.sin_family = AF_INET; |
1339 | memcpy(&mount_server_addr.sin_addr, | 1336 | memcpy(&mount_server_addr.sin_addr, hp->h_addr_list[0], sizeof(struct in_addr)); |
1340 | hp->h_addr, hp->h_length); | ||
1341 | } | 1337 | } |
1342 | } | 1338 | } |
1343 | 1339 | ||