public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug corefiles/13652] New: non elf core file whose whose size is greater than zero && u.u_dsize == 0 && u.u_ssize == 0 are being recognized as tad-core
@ 2012-02-02 4:29 vijunag at gmail dot com
2012-02-02 4:56 ` [Bug corefiles/13652] " vijunag at gmail dot com
0 siblings, 1 reply; 2+ messages in thread
From: vijunag at gmail dot com @ 2012-02-02 4:29 UTC (permalink / raw)
To: gdb-prs
http://sourceware.org/bugzilla/show_bug.cgi?id=13652
Bug #: 13652
Summary: non elf core file whose whose size is greater than
zero && u.u_dsize == 0 && u.u_ssize == 0 are being
recognized as tad-core
Product: gdb
Version: 6.8
Status: NEW
Severity: normal
Priority: P2
Component: corefiles
AssignedTo: unassigned@sourceware.org
ReportedBy: vijunag@gmail.com
Classification: Unclassified
In tradcore target format checking i.e. in
trad_unix_core_file_p() magic is not being used to validate if core matches
tradcore target.
If for eg sizeof(u) == u and if u.u_dsize ==0 && u.u_ssize == 0
then core file is being recognized as tradcore target instead of checking
for the magic numbers u.magic.
if (bfd_seek (abfd, (file_ptr) TRAD_CORE_USER_OFFSET, SEEK_SET) != 0)
return 0;
#endif
val = bfd_bread ((void *) &u, (bfd_size_type) sizeof u, abfd);
if (val != sizeof u)
{
/* Too small to be a core file */
bfd_set_error (bfd_error_wrong_format);
return 0;
}
/* Sanity check perhaps??? */
if (u.u_dsize > 0x1000000) /* Remember, it's in pages... */
{
bfd_set_error (bfd_error_wrong_format);
return 0;
}
if (u.u_ssize > 0x1000000)
{
bfd_set_error (bfd_error_wrong_format);
return 0;
}
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-02-02 4:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-02 4:29 [Bug corefiles/13652] New: non elf core file whose whose size is greater than zero && u.u_dsize == 0 && u.u_ssize == 0 are being recognized as tad-core vijunag at gmail dot com
2012-02-02 4:56 ` [Bug corefiles/13652] " vijunag at gmail dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).