Skip to content

Commit c85efcd

Browse files
authored
CVE fix (#373)
* Fixes for CVE-2024-21646 * changelog update * add back function * fix windows build * move install for windows compiler
1 parent 9571859 commit c85efcd

File tree

5 files changed

+136
-25
lines changed

5 files changed

+136
-25
lines changed

.azure-pipelines/client.test.live.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ jobs:
9898
displayName: Install build script requirements
9999
100100
- script: |
101+
call "$(VS_ENTERPRISE_PATH)\VC\Auxiliary\Build\vcvars64.bat"
101102
python -m pip install cibuildwheel==2.16.2
102103
displayName: Install cibuildwheel 2.16.2
103104
104105
- pwsh: |
105-
call "$(VS_ENTERPRISE_PATH)\VC\Auxiliary\Build\vcvars64.bat"
106106
cibuildwheel --output-dir dist .
107107
displayName: 'Build uAMQP Wheel'
108108
env:

HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
33
Release History
44
===============
5+
1.6.7 (2024-01-17)
6+
+++++++++++++++++++
7+
8+
- Fixes for CVE-2024-21646
9+
510
1.6.6 (2023-11-16)
611
+++++++++++++++++++
712

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ set(source_h_files
373373
./inc/azure_c_shared_utility/tlsio.h
374374
./inc/azure_c_shared_utility/optionhandler.h
375375
./inc/azure_c_shared_utility/memory_data.h
376+
./inc/azure_c_shared_utility/safe_math.h
376377
${LOGGING_STACKTRACE_H_FILE}
377378
)
378379

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Copyright (c) Microsoft. All rights reserved.
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
#ifndef SAFE_MATH_H
5+
#define SAFE_MATH_H
6+
7+
#ifndef SIZE_MAX
8+
#define SIZE_MAX ((size_t)((size_t)~(size_t)0))
9+
#endif
10+
11+
#define safe_add_size_t(a, b) ((((size_t)(a)) < ((size_t)(SIZE_MAX - ((size_t)(b))))) ? ((size_t)(a) + (size_t)(b)) : SIZE_MAX)
12+
13+
#define safe_subtract_size_t(a, b) (((a) >= (b)) ? ((size_t)(a) - (size_t)(b)) : SIZE_MAX)
14+
15+
#define safe_multiply_size_t(a, b) (((a) == 0 || (b) == 0) ? 0 : (((SIZE_MAX / (size_t)(a)) >= (size_t)(b)) ? (size_t)(a) * (size_t)(b) : SIZE_MAX))
16+
17+
#endif // SAFE_MATH_H

0 commit comments

Comments
 (0)