Ticket #1813 (closed enhancement: wontfix)

Opened 15 years ago

Last modified 14 years ago

Statifc buffer version of name_quote()

Reported by: metux Owned by: metux
Priority: major Milestone:
Component: mc-core Version: 4.7.0-pre4
Keywords: Cc:
Blocked By: Blocking:
Branch state: Votes for changeset:

Description

name_quote(), which returns a newly allocated string, is used in many places where a static buffer (eg. on stack) would be fully sufficient.

Change History

comment:1 Changed 15 years ago by metux

  • Status changed from new to accepted

comment:2 Changed 15 years ago by andrew_b

And what size of that static buffer will be fully sufficient?

comment:3 Changed 15 years ago by metux

PATH_MAX ?

comment:4 Changed 15 years ago by andrew_b

  1. What about potential buffer overflow in execute_menu_command() (src/user.c:654)? User's input parameter is not length-limited.
  1. The static buffer is effective when you allocate and free some piece of memory very often, many (hundred or thousand) times per second. But name_quote() is called once in each place where it's called.

comment:5 Changed 14 years ago by andrew_b

  • Status changed from accepted to testing
  • Resolution set to wontfix
  • Milestone 4.7 deleted

comment:6 Changed 14 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.