Commit Graph

949 Commits

Author SHA1 Message Date
Mike Crowe
b8d259fb88 directory_iterator_construct: Avoid provoking undefined behaviour
The directory_iterator(const path& p) constructor calls
detail::directory_iterator_construct passing nullptr (as 0) for the ec
parameter.

detail::directory_iterator_construct may call
directory_iterator::increment(*ec) which dereferences the nullptr provoking
undefined behaviour.

On GCC, and probably many other compilers, it seems that this merely causes
a null reference to be passed to directory_iterator::increment which in
turn, turns it back into nullptr when calling
detail::directory_iterator_increment which knows how to deal with the
nullptr and is happy.

Unfortunately, directory_iterator::increment(system::error_code& ec) is
marked noexcept (unlike the version that takes no arguments) but
detail::directory_iterator_increment throws exceptions when ec == nullptr.
This results in std::terminate being called.

The simplest way to fix this is for detail::directory_iterator_construct to
just pass on the potentially-nullptr ec argument to
detail::directory_iterator_increment rather than going via the
potentially-noexcept directory_iterator::increment member function.

(Discovered in the field with Boost 1.63 and a faulty disk. I managed to
reproduce the problem by teaching dir_itr_increment to pretend that
readdir_r_simulator returned an error when it saw a certain filename.)
2018-06-29 14:53:47 +01:00
Peter Dimov
5a93351bfd Merge pull request #51 from hammond/sysconf-errno
Reset 'errno' after 'sysconf()'
boost-1.68.0
2018-06-05 13:11:02 +03:00
Peter Dimov
37b324ceab Install libstdc++-4.9 on clang-4.0, 5.0 2018-05-09 20:09:23 +03:00
Peter Dimov
6f31d4e07c Merge pull request #69 from alexeikh/pr/fix-file-offset-bits-64
Fix compilation for Android and clean up _FILE_OFFSET_BITS #if-ery
2018-05-09 18:14:24 +03:00
Beman
cd6fead714 Upgrade MSVC Platform Toolset to 141. 2018-04-10 07:56:37 -04:00
Beman
4bd92f00bb Initial commit of Beman's Windows b2 test script 2018-04-10 07:52:04 -04:00
Alexei Khlebnikov
3d3d504b25 Do not define _FILE_OFFSET_BITS for Android APIs < 24. 2018-03-06 23:53:03 +01:00
Alexei Khlebnikov
f721c56ea6 Improved comment about why _FILE_OFFSET_BITS should be defined for most systems. 2018-03-04 16:56:59 +01:00
Andrey Semashev
716567aa9e Added a check for whether the size argument to resize_file exceeds off_t limit.
This check is especially useful on 32-bit systems which have no support for
64-bit file offsets (like older Android).
2018-03-03 17:49:23 +01:00
Alexei Khlebnikov
b37e83640a Do not define _FILE_OFFSET_BITS for Android APIs < 21. 2018-03-03 17:35:28 +01:00
Alexei Khlebnikov
7717db0b3e Deduplicated and cleaned up _FILE_OFFSET_BITS #if-ery. 2018-03-03 16:50:57 +01:00
Alexei Khlebnikov
18c7f93440 Replaced for-internal-use macro __USE_FILE_OFFSET64 by for-public-use macro _FILE_OFFSET_BITS. 2018-03-03 16:47:54 +01:00
Alexei Khlebnikov
aea71c5864 Transformed _FILE_OFFSET_BITS #if-ery even more for better understanding. 2018-03-03 16:43:34 +01:00
Alexei Khlebnikov
e5b3740440 Transformed _FILE_OFFSET_BITS #if-ery for better understanding. 2018-03-03 16:39:18 +01:00
Peter Dimov
d8a6730d6e Do not return a reference to NULL in poison_category(), to make the test pass on clang with variant=release boost-1.67.0 2018-01-29 19:29:53 +02:00
Peter Dimov
c6a977c99f Avoid clang warning by removing the extra parentheses 2018-01-29 19:18:05 +02:00
Peter Dimov
e3976fb3d3 Merge pull request #62 from boostorg/pr/fix-icmp-init-issues
Use ad-hoc extension comparison to avoid initialization issues
2018-01-04 05:29:18 +02:00
Peter Dimov
9a9bf767fb Fix tests to better tolerate parallel execution 2017-12-19 02:44:43 +02:00
Peter Dimov
589bfb0436 Add quick test target (for CI) 2017-12-02 17:59:21 +02:00
Peter Dimov
1290dfa1dc Add #include <boost/next_prior.hpp>; no longer in utility.hpp 2017-12-02 03:59:46 +02:00
Peter Dimov
399dd6e1d6 Use ad-hoc extension comparison to avoid initialization issues 2017-11-22 19:20:16 +02:00
Peter Dimov
669d35d8db Merge branch 'feature/fix-op-unit-test' into feature/fix-cygwin-op-test 2017-11-22 17:34:13 +02:00
Peter Dimov
03eb5df380 Use SetEnvironmentVariableW on Cygwin too 2017-11-22 16:15:26 +02:00
Peter Dimov
1dc51988bb Make operations_unit_test take a current directory argument; pass one in test/Jamfile 2017-11-22 05:05:43 +02:00
Peter Dimov
93cab09a6b Add .travis.yml, appveyor.yml 2017-11-22 03:13:45 +02:00
Beman
44ce5b8e4f Merge branch 'develop' boost-1.66.0 2017-10-30 08:48:11 -04:00
Beman
07619fb370 Add Beman's local test results to aid tracking changes over time. 2017-08-24 08:00:38 -04:00
hammond
1e8de36542 Reset 'errno' after 'sysconf()' 2017-08-23 17:36:46 +02:00
Beman
49218481e5 Clean up some tutorial example code and fix the wording for it in the tutorial. Thanks to Anmol-Singh-Jaggi for pull request #11. 2017-08-07 20:01:08 -04:00
Beman
8a0ab2fdd9 Merge branch 'develop' boost-1.64.0 boost-1.65.1 boost-1.65.0 2017-04-06 07:10:42 -04:00
Beman
23b79b9459 Clear two -Wconversion warnings 2017-04-03 09:47:32 -04:00
Beman
7fd4214912 is_empty()overload with error_code parameter should not throw on error. Thanks to ldqrk for pull request #42 2017-04-03 09:36:43 -04:00
Beman
9144a8ebd7 Update release history. 2017-04-03 08:29:00 -04:00
Beman
12bcf2e6ea Merge branch 'Dani-Hub-develop' into develop 2017-04-02 16:44:25 -04:00
drgler
0e831d5c2d Extended patch for ticket #10731 and ticket #9480: Replace expensive call of RtlInitUnicodeString by wcslen and get rid of CompareStringOrdinal completely, because it has no longer any advantages. Also, replace Windows TEXT macro by selecting GetModuleHandleW with wide character argument to prevent any additional conversions. 2017-03-19 16:21:46 +01:00
drgler
14935c4c6d Extended patch for ticket #10731 and ticket #9480: Replace usage of non-portable _wcsicmp by appropriate Windows functions to realize a locale invariant case-insensitive binary Unicode comparison that match the underlying file name comparison. 2017-03-18 22:28:29 +01:00
drgler
755766a053 Patch for ticket #10731 and ticket #9480: Evaluate path.extension only once, perform (case-insensitive) string comparisons using the wchar_t variants from the CRT to prevent code conversions via path.string() calls. 2017-03-14 21:46:12 +01:00
Beman Dawes
7abef6488f Merge pull request #39 from cmuellner/for-develop
Fix errno propagation in space(p, ec).
2017-01-09 17:37:43 -05:00
Beman
170f483655 Add test/config_info.cpp to increase macro state reporting in hopes of easing debugging on remote machines. 2017-01-08 15:23:42 -05:00
Beman
0840598bb1 Merge branch 'develop' 2017-01-08 06:48:01 -05:00
Beman
4ccb6c38f2 Start release history for 1.64 2016-12-30 14:52:52 -05:00
Beman
2550f407f4 MinGW defines __MINGW32__ rather than _MSC_VER, so also test for __MINGW32__ to see if setenv/unsetenv workaround needed. 2016-12-30 10:09:31 -05:00
Christoph Müllner
7f1a6992e3 Fix errno propagation in space(p, ec).
The space(p, ec) implementation assigned a wrong
error value to the given error_code object.
Instead of getting the error value from errno,
the code used the value '-1!=0'.

Signed-off-by: Christoph Müllner <christophm30@gmail.com>
2016-12-12 00:42:54 +01:00
Beman
163631cc7d ticket #12574 was just user confusion, but are the tests are worth keeping. 2016-11-28 08:29:08 -05:00
Beman
559188c951 Merge branch 'develop' boost-1.64.0-beta2 boost-1.64.0-beta1 boost-1.63.0 2016-11-26 14:55:02 -05:00
Beman
93429f24a1 Update release_history.html for pull request #31. 2016-11-26 14:27:33 -05:00
Beman Dawes
fca046d0c4 Merge pull request #31 from faithandbrave/patch-1
fix docs for signature stem(), extension() member functions
2016-11-26 14:18:26 -05:00
Beman
15c7706111 Fix create directory testing boo boo; Turns out " " is a valid file and directory name on Linux (and I'm guessing other POSIX-like systems). Add a POSIX-only test; "/foo" was reported to cause a crash on an earlier version. Don't test this on Windows since a user may well have sufficient permissions to create a directory in root. 2016-11-24 14:34:00 -05:00
Beman
4e4374336c Fix #7307, remove_all(dirname,ec) throws on write protected directories. This is a tough one to test. There are three internal function calls where errors might arise, and it would take too much time to write tests for each of those cases. Someday we will have Titus Winter's mock installable file system, but for now are relying on code inspection rather than testing. 2016-11-23 12:02:09 -05:00
Beman
e34b838041 Document a couple of pull requests. 2016-11-23 10:51:47 -05:00