aboutsummaryrefslogtreecommitdiff
path: root/bfd/syms.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/syms.c')
-rw-r--r--bfd/syms.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/bfd/syms.c b/bfd/syms.c
index 0b0d26d..9d7a1f4 100644
--- a/bfd/syms.c
+++ b/bfd/syms.c
@@ -1192,7 +1192,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
{
nul_fun = stab;
nul_str = str;
- if (file_name >= (char *) info->strs + strsize)
+ if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
file_name = NULL;
if (stab + STABSIZE + TYPEOFF < info->stabs + stabsize
&& *(stab + STABSIZE + TYPEOFF) == (bfd_byte) N_SO)
@@ -1203,7 +1203,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
directory_name = file_name;
file_name = ((char *) str
+ bfd_get_32 (abfd, stab + STRDXOFF));
- if (file_name >= (char *) info->strs + strsize)
+ if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
file_name = NULL;
}
}
@@ -1213,7 +1213,8 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
/* The name of an include file. */
file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
/* PR 17512: file: 0c680a1f. */
- if (file_name >= (char *) info->strs + strsize)
+ /* PR 17512: file: 5da8aec4. */
+ if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
file_name = NULL;
break;
@@ -1331,7 +1332,7 @@ _bfd_stab_section_find_nearest_line (bfd *abfd,
if (val <= offset)
{
file_name = (char *) str + bfd_get_32 (abfd, stab + STRDXOFF);
- if (file_name >= (char *) info->strs + strsize)
+ if (file_name >= (char *) info->strs + strsize || file_name < (char *) str)
file_name = NULL;
*pline = 0;
}