1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00
Files
mariadb/server-tools
unknown 779d2f16ec Fix Bug #22242 Instance Manager: option-parsing errors
There was a memory overrun, which resulted in safemalloc
errors. Recommit with post-review fixes.


server-tools/instance-manager/instance_options.cc:
  Memory was overrun here: convert_dirname() adds a slash to the
  end of the string. Then it was removed (with end[-1]=0), but
  the overrun still happened, which caused sefemalloc to complain.
  
  The problem stemed from the fact that we converted the path to the
  binary, not to the directory. Now we first truncate the path and
  then convert the name of the directory, where the binary resides.
  
  E.g. Suppose that IM got an option --mysqld-path='/usr/local/bin/mysqld'.
  Then convert dirname was called. This routine takes a path to the
  dir (not binary!) and converts it for usage under particular OS.
  And at least for *nixes it *always* adds slash. E.g. for the path above
  convert_dirname() will result in path: '/usr/local/bin/mysqld/'
  Note the last slash. 
  
  The fix is to convert the path to the dir where the binary resides:
  /usr/local/bin/. Then we put back the binary name.
2006-11-22 19:07:05 +03:00
..
2006-09-01 10:32:12 +02:00