File tree Expand file tree Collapse file tree 6 files changed +35
-9
lines changed Expand file tree Collapse file tree 6 files changed +35
-9
lines changed Original file line number Diff line number Diff line change @@ -10,8 +10,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).
10
10
11
11
### Changed
12
12
13
+ - Updated embedded protozero to 1.4.4.
14
+
13
15
### Fixed
14
16
17
+ - Buffer overflow in osmium::Buffer.
18
+
15
19
16
20
## [ 2.10.1] - 2016-11-15
17
21
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ documentation.
18
18
19
19
#include < cstdint>
20
20
#include < cassert>
21
- #include < type_traits>
22
21
23
22
#include < protozero/config.hpp>
24
23
@@ -51,9 +50,32 @@ inline uint64_t byteswap_impl(uint64_t value) noexcept {
51
50
#endif
52
51
}
53
52
54
- template <typename T>
55
- inline void byteswap_inplace (T& value) noexcept {
56
- value = static_cast <T>(byteswap_impl (static_cast <typename std::make_unsigned<T>::type>(value)));
53
+ inline void byteswap_inplace (uint32_t * ptr) noexcept {
54
+ *ptr = byteswap_impl (*ptr);
55
+ }
56
+
57
+ inline void byteswap_inplace (uint64_t * ptr) noexcept {
58
+ *ptr = byteswap_impl (*ptr);
59
+ }
60
+
61
+ inline void byteswap_inplace (int32_t * ptr) noexcept {
62
+ auto bptr = reinterpret_cast <uint32_t *>(ptr);
63
+ *bptr = byteswap_impl (*bptr);
64
+ }
65
+
66
+ inline void byteswap_inplace (int64_t * ptr) noexcept {
67
+ auto bptr = reinterpret_cast <uint64_t *>(ptr);
68
+ *bptr = byteswap_impl (*bptr);
69
+ }
70
+
71
+ inline void byteswap_inplace (float * ptr) noexcept {
72
+ auto bptr = reinterpret_cast <uint32_t *>(ptr);
73
+ *bptr = byteswap_impl (*bptr);
74
+ }
75
+
76
+ inline void byteswap_inplace (double * ptr) noexcept {
77
+ auto bptr = reinterpret_cast <uint64_t *>(ptr);
78
+ *bptr = byteswap_impl (*bptr);
57
79
}
58
80
59
81
} // end namespace detail
Original file line number Diff line number Diff line change @@ -200,7 +200,7 @@ class const_fixed_iterator {
200
200
value_type result;
201
201
std::memcpy (&result, m_data, sizeof (value_type));
202
202
#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
203
- detail::byteswap_inplace (result);
203
+ detail::byteswap_inplace (& result);
204
204
#endif
205
205
return result;
206
206
}
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ class pbf_reader {
77
77
skip_bytes (sizeof (T));
78
78
std::memcpy (&result, m_data - sizeof (T), sizeof (T));
79
79
#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
80
- detail::byteswap_inplace (result);
80
+ detail::byteswap_inplace (& result);
81
81
#endif
82
82
return result;
83
83
}
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ class pbf_writer {
91
91
protozero_assert (m_pos == 0 && " you can't add fields to a parent pbf_writer if there is an existing pbf_writer for a submessage" );
92
92
protozero_assert (m_data);
93
93
#if PROTOZERO_BYTE_ORDER != PROTOZERO_LITTLE_ENDIAN
94
- detail::byteswap_inplace (value);
94
+ detail::byteswap_inplace (& value);
95
95
#endif
96
96
m_data->append (reinterpret_cast <const char *>(&value), sizeof (T));
97
97
}
Original file line number Diff line number Diff line change @@ -23,13 +23,13 @@ documentation.
23
23
#define PROTOZERO_VERSION_MINOR 4
24
24
25
25
// / The patch number
26
- #define PROTOZERO_VERSION_PATCH 3
26
+ #define PROTOZERO_VERSION_PATCH 4
27
27
28
28
// / The complete version number
29
29
#define PROTOZERO_VERSION_CODE (PROTOZERO_VERSION_MAJOR * 10000 + PROTOZERO_VERSION_MINOR * 100 + PROTOZERO_VERSION_PATCH)
30
30
31
31
// / Version number as string
32
- #define PROTOZERO_VERSION_STRING " 1.4.3 "
32
+ #define PROTOZERO_VERSION_STRING " 1.4.4 "
33
33
34
34
35
35
#endif // PROTOZERO_VERSION_HPP
You can’t perform that action at this time.
0 commit comments