D20643: Fix invalid memory write on malformed tar files

2019-04-18 Thread Albert Astals Cid
aacid closed this revision. REPOSITORY R243 KArchive REVISION DETAIL https://phabricator.kde.org/D20643 To: aacid, apol Cc: apol, kde-frameworks-devel, michaelh, ngraham, bruns

D20643: Fix invalid memory write on malformed tar files

2019-04-17 Thread Aleix Pol Gonzalez
apol accepted this revision. apol added inline comments. This revision is now accepted and ready to land. INLINE COMMENTS > aacid wrote in ktar.cpp:241 > You mean also printing std::numeric_limits::max() ? I meant in a comment, but yeah, it's on the warning already. REPOSITORY R243 KArchive

D20643: Fix invalid memory write on malformed tar files

2019-04-17 Thread Albert Astals Cid
aacid added inline comments. INLINE COMMENTS > apol wrote in ktar.cpp:241 > It could make sense to say that it's because of the maximum size longling can > have in a comment. You mean also printing std::numeric_limits::max() ? REPOSITORY R243 KArchive REVISION DETAIL https://phabricator.k

D20643: Fix invalid memory write on malformed tar files

2019-04-17 Thread Aleix Pol Gonzalez
apol added a comment. +1 in general INLINE COMMENTS > ktar.cpp:241 > size--;// ignore trailing null > +if (size > std::numeric_limits::max()) { > +qCWarning(KArchiveLog) << "Failed to allocate memory for longlink of > size" << size; It could make sense to say that it's

D20643: Fix invalid memory write on malformed tar files

2019-04-17 Thread Albert Astals Cid
aacid created this revision. Herald added a project: Frameworks. Herald added a subscriber: kde-frameworks-devel. aacid requested review of this revision. REVISION SUMMARY If the file says it has a longlink of more than int_max bytes, the resize would do nothing (since casting to int means a ne