Bug #431

ps2raster calls strcpy with to and from pointer that overlap

Added by Paul almost 4 years ago. Updated almost 4 years ago.

Status:ClosedStart date:2013-11-07
Priority:HighDue date:
Assignee:-% Done:

0%

Category:-
Target version:Candidate for next bugfix release
Affected version:4.5.11 Platform:

Description

This is now illegal in OS X Mavericks and suddenly results in a crash. We need to avoid this situation and should check for other strcpy calls as well.

History

#1 Updated by Paul almost 4 years ago

  • Status changed from New to Closed

Managed to get a duplicate issue. Closing this one.

#2 Updated by Florian almost 4 years ago

  • Subject changed from ps2raster calls strcpy with to and from pointer being the same to ps2raster calls strcpy with to and from pointer that overlap
  • Status changed from Closed to In Progress

Deleted the duplicate.

Note that this is not a Mavericks bug. This is a general issue because strcpy's behavior is undefined with overlapping strings: http://pubs.opengroup.org/onlinepubs/009695399/functions/strcpy.html.

Running GMT 4 tests through valgrind would probably indicate many of these problems.

#3 Updated by Paul almost 4 years ago

Yes, it is not a "bug" but the sudden decision to disallow the overlapping strings. I understand the reasons (security) and I guess it is too much to ask to get a memo before they release libraries with the new behavior. So now we and others suddenly have a condition that crashes ps2raster under Mavericks, an unnecessary problem....

#4 Updated by Paul almost 4 years ago

  • Status changed from In Progress to Resolved

Fixed in r10146.

#5 Updated by Paul almost 4 years ago

  • Status changed from Resolved to Closed

Closing this issue.

Also available in: Atom PDF