extlinux: Avoid dereferencing a garbage pointer

If opt.reset_adv is set the call to ext_read_adv() is skipped which
would have initialised 'filename'. This means that a pointer
containing random data from the stack is passed to ext_write_adv().

Just delete the opt.reset_adv logic since modify_adv() handles that
case anyway.

Reported-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
fs: Fix searchdir resource leak

This is a significant rewrite of the generic lookup logic inside
core/fs/fs.c's searchdir function.  Previously, there was a
memory leak if a path involved multiple directories.  After a
sufficiently large number of invocations, this could be observed.

Reported-by: Ady <ady-sf@hotmail.com>
Signed-off-by: Shao Miller <sha0.miller@gmail.com>
Merge branch 'searchdir_leak-406' of git://git.zytor.com/users/sha0/syslinux into stable

Pull a change that fixes a resource leak from Shao Miller,

* 'searchdir_leak-406' of git://git.zytor.com/users/sha0/syslinux:
  fs: Fix searchdir resource leak
isolinux: Update LBA in getlinsec loop

We need to increment the Logical Block Address in eax by the number of
sectors we passed to getlinsec after every invocation, otherwise we'll
start with the same sector everytime.

This bug was discovered when booting an isohybrid image, which failed
to boot after printing the following error,

    "Image checksum error, sorry..."

because the isolinux.bin was bigger than 32K, and thus invoked the
getlinsec loop that reads the file in chunks.

Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
menugen: Make it compatible with Py3k

Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>