NO

Author Topic: Pellesc 7.00.355 (Win64) swprintf Access Violation  (Read 2324 times)

ghost

  • Guest
Pellesc 7.00.355 (Win64) swprintf Access Violation
« on: July 24, 2014, 04:41:33 AM »
Building with machine setting X86 the following is producing an access violation:

(UNICODE,_UNICODE) is defined

Code: [Select]
char sz[] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; // 68 chars = access violation , 67 chars = code runs fine
TCHAR szw[500] = _T("");
swprintf(szw,500,_T("%s"),sz);


With machine setting X64 the code runs without error. Version info is attached as image.
« Last Edit: July 24, 2014, 04:44:09 AM by ghost »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: Pellesc 7.00.355 (Win64) swprintf Access Violation
« Reply #1 on: July 24, 2014, 10:48:39 AM »
Bleh. It's a buffer limit calculated as bytes (128), not wide characters (64), leading to a buffer overrun. Will fix it for version 8.0.
/Pelle

ghost

  • Guest
Re: Pellesc 7.00.355 (Win64) swprintf Access Violation
« Reply #2 on: July 24, 2014, 01:29:39 PM »
Thanks Pelle.