Skip to content

Commit 6dadc4a

Browse files
authored
Merge branch 'dev' into patch-OSV-2024-947
2 parents cd11aca + 5db5cad commit 6dadc4a

File tree

119 files changed

+11796
-14818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+11796
-14818
lines changed

.codespellrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[codespell]
2-
skip = *.dat,typos-config.toml,.git,.venv,./ci,./Dist,./mk,./Tests/ExamplesTest/expected_output,./Tests/ExamplesTest/pcap_examples,./Tests/Packet++Test/PacketExamples,./Tests/Pcap++Test/PcapExamples,./3rdParty,./Examples/PcapSearch/dirent-for-Visual-Studio
2+
skip = *.dat,typos-config.toml,.git,.venv,venv,./out,./ci,./Dist,./mk,./Tests/ExamplesTest/expected_output,./Tests/ExamplesTest/pcap_examples,./Tests/Packet++Test/PacketExamples,./Tests/Pcap++Test/PcapExamples,./3rdParty,./Examples/PcapSearch/dirent-for-Visual-Studio
33
ignore-words = codespell-ignore-list.txt
44
count =

.github/workflows/build_and_test.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
9292
- name: Restore Ccache
9393
id: ccache-restore
94-
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
94+
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
9595
with:
9696
path: |
9797
${{ env.CCACHE_DIR }}
@@ -156,7 +156,7 @@ jobs:
156156
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
157157

158158
- name: Save Ccache
159-
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
159+
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
160160
with:
161161
path: ${{ env.CCACHE_DIR }}
162162
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
@@ -179,7 +179,7 @@ jobs:
179179

180180
- name: Restore Ccache
181181
id: ccache-restore
182-
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
182+
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
183183
with:
184184
path: ${{ env.CCACHE_DIR }}
185185
key: ${{ matrix.image }}-ccache-${{ github.run_id }}
@@ -220,7 +220,7 @@ jobs:
220220
run: cd build_examples/tutorials_bin && ./Tutorial-HelloWorld
221221

222222
- name: Save Ccache
223-
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
223+
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
224224
with:
225225
path: ${{ env.CCACHE_DIR }}
226226
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
@@ -239,7 +239,7 @@ jobs:
239239

240240
- name: Restore Ccache
241241
id: ccache-restore
242-
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
242+
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
243243
with:
244244
path: ${{ env.CCACHE_DIR }}
245245
key: ${{ matrix.image }}-ccache-${{ github.run_id }}
@@ -277,7 +277,7 @@ jobs:
277277
run: cd build_examples/tutorials_bin && ./Tutorial-HelloWorld
278278

279279
- name: Save Ccache
280-
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
280+
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
281281
with:
282282
path: ${{ env.CCACHE_DIR }}
283283
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
@@ -331,7 +331,7 @@ jobs:
331331

332332
- name: Restore Ccache
333333
id: ccache-restore
334-
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
334+
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
335335
with:
336336
path: ${{ env.CCACHE_DIR }}
337337
key: ${{ matrix.os-version }}-${{ matrix.arch }}-ccache-${{ github.run_id }}
@@ -405,7 +405,7 @@ jobs:
405405
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
406406

407407
- name: Save Ccache
408-
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
408+
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
409409
with:
410410
path: ${{ env.CCACHE_DIR }}
411411
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
@@ -713,7 +713,7 @@ jobs:
713713
714714
- name: Restore Ccache
715715
id: ccache-restore
716-
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
716+
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
717717
with:
718718
path: ${{ env.CCACHE_DIR }}
719719
key: ${{ matrix.image }}-ccache-${{ github.run_id }}
@@ -753,7 +753,7 @@ jobs:
753753
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
754754

755755
- name: Save Ccache
756-
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
756+
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
757757
with:
758758
path: ${{ env.CCACHE_DIR }}
759759
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
@@ -782,7 +782,7 @@ jobs:
782782
783783
- name: Restore Ccache
784784
id: ccache-restore
785-
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
785+
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
786786
with:
787787
path: ${{ env.CCACHE_DIR }}
788788
key: ${{ matrix.engine }}-${{ matrix.sanitizer }}-ccache-${{ github.run_id }}
@@ -804,7 +804,7 @@ jobs:
804804
Tests/Fuzzers/RegressionTests/run_tests.sh
805805
806806
- name: Save Ccache
807-
uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
807+
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
808808
with:
809809
path: ${{ env.CCACHE_DIR }}
810810
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ repos:
2222
args: ['--fix=lf']
2323
- id: trailing-whitespace
2424
- repo: https://github.com/astral-sh/ruff-pre-commit
25-
rev: v0.8.4
25+
rev: v0.9.9
2626
hooks:
2727
- id: ruff # Run the linter.
2828
types_or: [ python ]
@@ -38,17 +38,17 @@ repos:
3838
- id: cppcheck
3939
args: ["--std=c++11", "--language=c++", "--suppressions-list=cppcheckSuppressions.txt", "--inline-suppr", "--force"]
4040
- repo: https://github.com/BlankSpruce/gersemi
41-
rev: 0.17.1
41+
rev: 0.19.1
4242
hooks:
4343
- id: gersemi
4444
args: ["-c"]
4545
- repo: https://github.com/codespell-project/codespell
46-
rev: v2.3.0
46+
rev: v2.4.1
4747
hooks:
4848
- id: codespell
4949
pass_filenames: false
5050
- repo: https://github.com/crate-ci/typos
51-
rev: codespell-dict-v0.5.0
51+
rev: typos-dict-v0.12.6
5252
hooks:
5353
- id: typos
5454
args: ['--config=typos-config.toml']

3rdParty/LightPcapNg/LightPcapNg/include/light_pcapng_ext.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern "C" {
3333
#include <stddef.h>
3434
#include <stdint.h>
3535
#ifdef _MSC_VER
36-
#include <Winsock2.h>
36+
#include <winsock2.h>
3737
#include <time.h>
3838
#else
3939
#include <sys/time.h>

3rdParty/LightPcapNg/LightPcapNg/src/light_pcapng.c

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,28 @@ static struct _light_option *__parse_options(uint32_t **memory, const int32_t ma
4949
opt->custom_option_code = *local_memory++;
5050
opt->option_length = *local_memory++;
5151

52+
// PCPP patch
53+
// Validate option_length
54+
if (opt->option_length > max_len - 2 * sizeof(*local_memory)) {
55+
free(opt);
56+
return NULL;
57+
}
58+
// PCPP patch end
59+
5260
actual_length = (opt->option_length % alignment) == 0 ?
5361
opt->option_length :
5462
(opt->option_length / alignment + 1) * alignment;
5563

56-
if (actual_length > 0) {
57-
opt->data = calloc(1, actual_length);
58-
memcpy(opt->data, local_memory, actual_length);
59-
local_memory += (sizeof(**memory) / sizeof(*local_memory)) * (actual_length / alignment);
64+
// PCPP patch
65+
// Validate actual_length
66+
if (actual_length <= 0 || actual_length > max_len - 2 * sizeof(*local_memory)) {
67+
free(opt);
68+
return NULL;
6069
}
70+
opt->data = calloc(1, actual_length);
71+
memcpy(opt->data, local_memory, actual_length);
72+
local_memory += (sizeof(**memory) / sizeof(*local_memory)) * (actual_length / alignment);
73+
// PCPP patch end
6174

6275
*memory = (uint32_t*)local_memory;
6376
remaining_size = max_len - actual_length - 2 * sizeof(*local_memory);

0 commit comments

Comments
 (0)