modutils: remove redundant sanitization

This commit is contained in:
Denis Vlasenko 2009-04-13 20:32:31 +00:00
parent 2b2183a77d
commit 4144504912

View File

@ -5,7 +5,6 @@
* *
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/ */
#include "modutils.h" #include "modutils.h"
#ifdef __UCLIBC__ #ifdef __UCLIBC__
@ -111,9 +110,9 @@ char * FAST_FUNC parse_cmdline_module_options(char **argv)
int FAST_FUNC bb_init_module(const char *filename, const char *options) int FAST_FUNC bb_init_module(const char *filename, const char *options)
{ {
size_t len = MAXINT(ssize_t); size_t len;
char *image; char *image;
int rc = ENOENT; int rc;
if (!options) if (!options)
options = ""; options = "";
@ -124,10 +123,12 @@ int FAST_FUNC bb_init_module(const char *filename, const char *options)
#endif #endif
/* Use the 2.6 way */ /* Use the 2.6 way */
len = INT_MAX - 4095;
rc = ENOENT;
image = xmalloc_open_zipped_read_close(filename, &len); image = xmalloc_open_zipped_read_close(filename, &len);
if (image) { if (image) {
rc = 0; rc = 0;
if (init_module(image, len, options ? options : "") != 0) if (init_module(image, len, options) != 0)
rc = errno; rc = errno;
free(image); free(image);
} }