2011-03-01 Michael Snyder <msnyder@vmware.com>
* cli/cli-dump.c (restore_binary_file): Validate ftell return value.
This commit is contained in:
parent
dc19db01c1
commit
5e9e105f92
|
@ -1,5 +1,7 @@
|
||||||
2011-03-01 Michael Snyder <msnyder@vmware.com>
|
2011-03-01 Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
* cli/cli-dump.c (restore_binary_file): Validate ftell return value.
|
||||||
|
|
||||||
* ada-lang.c (ada_make_symbol_completion_list): Replace malloc
|
* ada-lang.c (ada_make_symbol_completion_list): Replace malloc
|
||||||
with xmalloc.
|
with xmalloc.
|
||||||
|
|
||||||
|
|
|
@ -511,7 +511,11 @@ restore_binary_file (char *filename, struct callback_data *data)
|
||||||
|
|
||||||
/* Get the file size for reading. */
|
/* Get the file size for reading. */
|
||||||
if (fseek (file, 0, SEEK_END) == 0)
|
if (fseek (file, 0, SEEK_END) == 0)
|
||||||
len = ftell (file);
|
{
|
||||||
|
len = ftell (file);
|
||||||
|
if (len < 0)
|
||||||
|
perror_with_name (filename);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
perror_with_name (filename);
|
perror_with_name (filename);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue