This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Prevent overflow in rl_set_screen_size


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> so if the function takes int parameters without specifying an upper bound, it
Pedro> seems like a readline bug to me to not consider large numbers.

True, though it doesn't hurt to also check in gdb.

What's funny is that readline *does* check for negative values:

  if (rows > 0)
    _rl_screenheight = rows;
  .. etc ..

So gdb's approach:

  if (rows <= 0)
    rows = INT_MAX;

... actively works around the existing checks in readline.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]