Menu

#12 bin2tap -b option fails with overflow in Linux

1.0
closed
None
1 day ago
5 days ago
No

When using bin2tap with the -b option to add a BASIC loader, it creates a 0 sized tap file and then aborts with a buffer overflow error:

*** buffer overflow detected ***: terminated

Steps to reproduce:

  1. Compile zxspectrum-utils 1.2 in Arch Linux, you can use the AUR package in https://aur.archlinux.org/packages/zxspectrum-utils.
  2. Create a simple "hello, world!" assembler program, ORG $8000 for example.
  3. Assemble with "pasmo" or another cross assembler and output a "test.o" binary file.
  4. Execute bin2tap -b -o test.tap test.o and see the buffer overflow error.

Discussion

  • Michal Jurica

    Michal Jurica - 5 days ago
    • assigned_to: Michal Jurica
     
  • Michal Jurica

    Michal Jurica - 5 days ago
    • status: open --> accepted
     
  • Michal Jurica

    Michal Jurica - 3 days ago

    I updated the bin2tap to be friendly with modern compilers.

     
  • Michal Jurica

    Michal Jurica - 3 days ago
    • status: accepted --> closed
     
  • Miguel Barrio Orsikowsky

    Now bin2tap -b runs fine, but it creates a BASIC program that seems to be corrupt at line 50 (LOAD ""CODE) and crashes the Speccy when running:

      10 REM loader by bin2tap1.4
      20 BORDER VAL "0": PAPER VAL "0": INK VAL "7"
      30 CLEAR VAL "24575"
      50 LOAD "test"CODE ?<<?? RANDOMIZE USR VAL "32768"
    ?420 RANDOMIZE USR VAL "32768"
    

    The "test" code runs fine using this:

      10 CLEAR 32767
      20 LOAD "test"CODE
      30 RANDOMIZE USR 32768
    
     
  • Michal Jurica

    Michal Jurica - 2 days ago
    • status: closed --> open
     
  • Michal Jurica

    Michal Jurica - 2 days ago

    I rewrote the loader generator to prevent these bugs. Please, test it again.

     
  • Miguel Barrio Orsikowsky

    Now it works perfectly, thank you!

     
  • Michal Jurica

    Michal Jurica - 1 day ago
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB