[MacPorts] #43632: cdrtools @3.00_1: mkisofs receives abort trap on Mavericks host if -graft-points option is used
#43632: cdrtools @3.00_1: mkisofs receives abort trap on Mavericks host if -graft- points option is used ------------------------+-------------------------------- Reporter: galitsyn@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Keywords: mkisofs | Port: cdrtools ------------------------+-------------------------------- Hi Guys! The problem might be easily reproduced here if the next command line is executed: {{{ mkisofs -graft-points a=b }}} This issue occurs on Mavericks (10.9.2) host only and I can't reproduce it on Mountain Lion (10.8.5) host. I took a look to the ftp://ftp.berlios.de/pub/cdrecord/cdrtools-3.00.tar.bz2 sources and was able to fix it for myself. The patch below fixes the issue: {{{ --- cdrtools-3.00/mkisofs/mkisofs.c.orig 2010-04-25 18:29:03.000000000 +0400 +++ cdrtools-3.00/mkisofs/mkisofs.c 2014-05-08 18:04:33.000000000 +0400 @@ -3235,15 +3235,15 @@ /* * Remove unwanted "./" & "/" sequences from start... */ + xpnt = graft_point; do { - xpnt = graft_point; while (xpnt[0] == '.' && xpnt[1] == '/') xpnt += 2; while (*xpnt == PATH_SEPARATOR) { xpnt++; } - strlcpy(graft_point, xpnt, glen); - } while (xpnt > graft_point); + } while (graft_point++ < glen); + graft_point = xpnt; if (node) { node = escstrcpy(nodename, nlen, ++node); }}} The problem was that strlcpy() used source and destination strings which overlap. Could you please take a look to the issue? Thank you! -- Ticket URL: <https://trac.macports.org/ticket/43632> MacPorts <http://www.macports.org/> Ports system for OS X
#43632: cdrtools @3.00_1: mkisofs receives abort trap on Mavericks host if -graft- points option is used -------------------------+-------------------------------- Reporter: galitsyn@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: mkisofs Port: cdrtools | -------------------------+-------------------------------- Comment (by galitsyn@…): Oh, the patch above is not correct =) The below one looks a bit better: {{{ --- cdrtools-3.00/mkisofs/mkisofs.c.orig 2010-04-25 18:29:03.000000000 +0400 +++ cdrtools-3.00/mkisofs/mkisofs.c 2014-05-08 19:25:14.000000000 +0400 @@ -3235,15 +3235,16 @@ /* * Remove unwanted "./" & "/" sequences from start... */ + xpnt = graft_point; + size_t gidx = 0; do { - xpnt = graft_point; while (xpnt[0] == '.' && xpnt[1] == '/') xpnt += 2; while (*xpnt == PATH_SEPARATOR) { xpnt++; } - strlcpy(graft_point, xpnt, glen); - } while (xpnt > graft_point); + } while ((xpnt[0] == '.' || xpnt[0] == '/') && gidx++ < glen); + graft_point = xpnt; if (node) { node = escstrcpy(nodename, nlen, ++node); }}} -- Ticket URL: <https://trac.macports.org/ticket/43632#comment:1> MacPorts <http://www.macports.org/> Ports system for OS X
#43632: cdrtools @3.00_1: mkisofs receives abort trap on Mavericks host if -graft- points option is used -------------------------+------------------------- Reporter: galitsyn@… | Owner: bytestorm@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cdrtools | -------------------------+------------------------- Changes (by mf2k@…): * keywords: mkisofs => * owner: macports-tickets@… => bytestorm@… Comment: Please attach your patches to this ticket, not paste them inline. In the future, please Cc the port maintainers ({{{port info --maintainers cdrtools}}}). -- Ticket URL: <https://trac.macports.org/ticket/43632#comment:2> MacPorts <http://www.macports.org/> Ports system for OS X
#43632: cdrtools @3.00_1: mkisofs receives abort trap on Mavericks host if -graft- points option is used -------------------------+------------------------- Reporter: galitsyn@… | Owner: bytestorm@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 2.2.1 Resolution: | Keywords: Port: cdrtools | -------------------------+------------------------- Comment (by galitsyn@…): Sure, sorry for that. Attaching the last patch. -- Ticket URL: <https://trac.macports.org/ticket/43632#comment:3> MacPorts <http://www.macports.org/> Ports system for OS X
participants (1)
-
MacPorts