Skip to content

Commit

Permalink
Merge pull request #1716 from silvergasp/master
Browse files Browse the repository at this point in the history
fuzz: Add support for fuzzing
  • Loading branch information
hathach committed Dec 8, 2022
2 parents ab8cfb3 + c19bffb commit d4620d9
Show file tree
Hide file tree
Showing 36 changed files with 2,727 additions and 57 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build_aarch64.yml
Expand Up @@ -3,17 +3,17 @@ name: Build AArch64
on:
push:
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
pull_request:
branches: [ master ]
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build_arm.yml
Expand Up @@ -3,17 +3,17 @@ name: Build ARM
on:
push:
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
pull_request:
branches: [ master ]
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build_esp.yml
Expand Up @@ -3,17 +3,17 @@ name: Build ESP
on:
push:
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
pull_request:
branches: [ master ]
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build_msp430.yml
Expand Up @@ -3,17 +3,17 @@ name: Build MSP430
on:
push:
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
pull_request:
branches: [ master ]
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build_renesas.yml
Expand Up @@ -3,17 +3,17 @@ name: Build Renesas
on:
push:
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
pull_request:
branches: [ master ]
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build_riscv.yml
Expand Up @@ -3,17 +3,17 @@ name: Build RISC-V
on:
push:
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
pull_request:
branches: [ master ]
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/pre-commit.yml
Expand Up @@ -34,4 +34,13 @@ jobs:
# Install Ceedling
gem install ceedling
cd test/unit-test
ceedling test:all
ceedling test:all
- name: Build Fuzzer
run: |
fuzz_harness=$(ls -d test/fuzz/device/*/)
for h in $fuzz_harness
do
make -C $h get-deps
make -C $h all
done
16 changes: 8 additions & 8 deletions .github/workflows/test_hardware.yml
Expand Up @@ -3,17 +3,17 @@ name: Hardware Test
on:
push:
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
pull_request:
branches: [ master ]
paths:
- 'src'
- 'examples'
- 'lib'
- 'hw'
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'

# Hardware in the loop (HIL)
# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
Expand Down
1 change: 1 addition & 0 deletions src/class/cdc/cdc_device.c
Expand Up @@ -171,6 +171,7 @@ uint32_t tud_cdc_n_write(uint8_t itf, void const* buffer, uint32_t bufsize)
uint16_t ret = tu_fifo_write_n(&p_cdc->tx_ff, buffer, (uint16_t) bufsize);

// flush if queue more than packet size
// may need to suppress -Wunreachable-code since most of the time CFG_TUD_CDC_TX_BUFSIZE < BULK_PACKET_SIZE
if ( (tu_fifo_count(&p_cdc->tx_ff) >= BULK_PACKET_SIZE) || ((CFG_TUD_CDC_TX_BUFSIZE < BULK_PACKET_SIZE) && tu_fifo_full(&p_cdc->tx_ff)) )
{
tud_cdc_n_write_flush(itf);
Expand Down

0 comments on commit d4620d9

Please sign in to comment.