dMZX Forums: String compares prior to 2.81 used strcasecmp() -> Archived MegaZeux Bugs -> Tracker

Jump to content

Report ID 780 Title String compares prior to 2.81 used strcasecmp()
Product Archived MegaZeux Bugs Status Fixed (Severity 1 - Low)
Version 2.92 Fixed in 2.92d
Introduced In Version 2.81Operating System All platforms

Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Report ID #780: String compares prior to 2.81 used strcasecmp()

#1 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 23 July 2019 - 12:48 AM

Prior to 2.81, string comparisons used strcasecmp, and some games rely on this: Mines of Madness (#68874).

At some point, null termination of string values was removed. Versions from 2.81 onward replaced the strcasecmp with strncasecmp combined with a hacky check that returns the difference in lengths if the result is 0, and 2.81c further replaced strncasecmp with an endian-unsafe compare (and moved the length comparison first, breaking comparison for strings of different lengths). The bugs from these changes have since been fixed.

This could be fixed by having an alternate compare_strings implementation (without exact case/wildcard checks) that checks the next byte after the compare for \0 before returning -1/1. Since there are already version checks in string comparison it's doubtful checking this would add much (if any) overhead right now. I'd like to wait to see if anything else is found affected by this before patching it, but in any case it's a low-hanging fix for the next bugfix release.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository


Page 1 of 1  
  • Cannot start a new Issue
  • Closed Issue This issue is locked

Replies (1 - 2)

#2 User is offline  
Lachesis 

  • the pinnacle of human emotion
  • Group: DigiStaff
  • Posts: 3,904
  • Joined: 17-July 04
  • Gender:Female
  • Location:Sealand

Posted 29 April 2020 - 02:51 AM

Updating status to: Fixed
Issue fixed in: 2.92d

Fixed in GIT 1012da07.
"Let's just say I'm a GOOD hacker, AND virus maker. I'm sure you wouldn't like to pay for another PC would you?"

xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository

#3 User is offline  
Terryn 

  • ******
  • Group: DigiStaff
  • Posts: 2,961
  • Joined: 12-October 00
  • Gender:Male

Posted 09 May 2020 - 12:11 AM

Moving to: Archived MegaZeux Bugs


Page 1 of 1
  • Cannot start a new Issue
  • Closed Issue This issue is locked

0 User(s) are reading this issue
0 Guests and 0 Anonymous Users


Powered by IP.Tracker 1.3.2 © 2024  IPS, Inc.