aboutsummaryrefslogtreecommitdiff
path: root/binutils/bucomm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2011-01-06 11:34:28 +0000
committerNick Clifton <nickc@redhat.com>2011-01-06 11:34:28 +0000
commit9849fbfc4110f61ba10aa4a4d9114f3b6ac62237 (patch)
tree3e0f9daa5f80803f7b461ec39397d5a3c38be536 /binutils/bucomm.c
parent09050809a4d0bf939a31850595cda0e50750015b (diff)
downloadgdb-9849fbfc4110f61ba10aa4a4d9114f3b6ac62237.zip
gdb-9849fbfc4110f61ba10aa4a4d9114f3b6ac62237.tar.gz
gdb-9849fbfc4110f61ba10aa4a4d9114f3b6ac62237.tar.bz2
* bucomm.c (get_file_size): Check for negative sizes and issue a
warning message if encountered.
Diffstat (limited to 'binutils/bucomm.c')
-rw-r--r--binutils/bucomm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/binutils/bucomm.c b/binutils/bucomm.c
index b30c2c5..77afc10 100644
--- a/binutils/bucomm.c
+++ b/binutils/bucomm.c
@@ -1,6 +1,6 @@
/* bucomm.c -- Bin Utils COMmon code.
Copyright 1991, 1992, 1993, 1994, 1995, 1997, 1998, 2000, 2001, 2002,
- 2003, 2005, 2006, 2007, 2008, 2009, 2010
+ 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GNU Binutils.
@@ -577,6 +577,9 @@ get_file_size (const char * file_name)
}
else if (! S_ISREG (statbuf.st_mode))
non_fatal (_("Warning: '%s' is not an ordinary file"), file_name);
+ else if (statbuf.st_size < 0)
+ non_fatal (_("Warning: '%s' has negative size, probably it is too large"),
+ file_name);
else
return statbuf.st_size;