return NULL;
}
fseek(f, 0, SEEK_END);
- unsigned int fsize = (unsigned int)ftell(f);
- if (fsize > 4294967295) {
+ long int fsize = ftell(f);
+ if (fsize < 0) {
LOGE("Wrong file size");
fclose(f);
return NULL;
}
fseek(f, 0, SEEK_SET);
- char *script = new char [fsize + 2147483648 + 1];
+ char *script = new char [fsize + 1];
long int ret = fread(script, 1, fsize, f);
if (ret != fsize) {
LOGE("Couldn't read vc-webview.js file %d, %d", fsize, ret);
if (m_custom_name.compare(file_name) != 0) {
fseek(f, 0, SEEK_END);
long int fsize = ftell(f);
+ if (fsize < 0) {
+ LOGE("Wrong file size");
+ fclose(f);
+ return;
+ }
fseek(f, 0, SEEK_SET);
- char *script = new char [fsize + 2147483648 + 1];
+ char *script = new char [fsize + 1];
long int ret = fread(script, 1, fsize, f);
if (ret != fsize) {
LOGE("Couldn't read vc-webview.js file %d, %d", fsize, ret);