Date: Sun, 19 Jan 2014 13:38:40 +0000 (UTC) From: Kai Wang <kaiw@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r260878 - projects/elftoolchain/contrib/elftoolchain/libdwarf Message-ID: <201401191338.s0JDceL0023102@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kaiw Date: Sun Jan 19 13:38:40 2014 New Revision: 260878 URL: http://svnweb.freebsd.org/changeset/base/260878 Log: Add a sanity check: The provided offset for the desired location list should not exceed the size of the .debug_loc section. Modified: projects/elftoolchain/contrib/elftoolchain/libdwarf/libdwarf_loclist.c Modified: projects/elftoolchain/contrib/elftoolchain/libdwarf/libdwarf_loclist.c ============================================================================== --- projects/elftoolchain/contrib/elftoolchain/libdwarf/libdwarf_loclist.c Sun Jan 19 07:44:14 2014 (r260877) +++ projects/elftoolchain/contrib/elftoolchain/libdwarf/libdwarf_loclist.c Sun Jan 19 13:38:40 2014 (r260878) @@ -127,6 +127,11 @@ _dwarf_loclist_add(Dwarf_Debug dbg, Dwar return (DW_DLE_NO_ENTRY); } + if (lloff >= ds->ds_size) { + DWARF_SET_ERROR(dbg, error, DW_DLE_NO_ENTRY); + return (DW_DLE_NO_ENTRY); + } + if ((ll = malloc(sizeof(struct _Dwarf_Loclist))) == NULL) { DWARF_SET_ERROR(dbg, error, DW_DLE_MEMORY); return (DW_DLE_MEMORY);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401191338.s0JDceL0023102>