Commit 9488ccf
committed
fix: Resolve critical bugs - file handle leaks and IndexError issues
Fixed multiple critical bugs identified during comprehensive code audit:
**Critical Fixes:**
- Fix file handle leaks in SDK client upload methods (sync and async)
- Use context managers to ensure file handles are properly closed
- Affects: sdk/src/fuzzforge_sdk/client.py lines 397, 484
**High Priority Fixes:**
- Fix IndexError in OSS-Fuzz stats parsing when accessing array elements
- Add bounds checking before accessing parts[i+1]
- Affects: workers/ossfuzz/activities.py lines 372-376
- Fix IndexError in exception handling URL parsing
- Add empty string validation before splitting URL segments
- Prevents crash when parsing malformed URLs
- Affects: sdk/src/fuzzforge_sdk/exceptions.py lines 419-426
**Medium Priority Fixes:**
- Fix IndexError in Android workflow SARIF report parsing
- Check if runs list is empty before accessing first element
- Affects: backend/toolbox/workflows/android_static_analysis/workflow.py line 270
All fixes follow defensive programming practices with proper bounds checking
and resource management using context managers.1 parent b2a720b commit 9488ccf
File tree
4 files changed
+29
-28
lines changed- backend/toolbox/workflows/android_static_analysis
- sdk/src/fuzzforge_sdk
- workers/ossfuzz
4 files changed
+29
-28
lines changedLines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
| 271 | + | |
271 | 272 | | |
272 | 273 | | |
273 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | 396 | | |
401 | 397 | | |
402 | 398 | | |
| |||
418 | 414 | | |
419 | 415 | | |
420 | 416 | | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
425 | 423 | | |
426 | | - | |
427 | | - | |
| 424 | + | |
| 425 | + | |
428 | 426 | | |
429 | 427 | | |
430 | 428 | | |
| |||
480 | 478 | | |
481 | 479 | | |
482 | 480 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
487 | 481 | | |
488 | 482 | | |
489 | 483 | | |
| |||
494 | 488 | | |
495 | 489 | | |
496 | 490 | | |
497 | | - | |
498 | | - | |
499 | | - | |
500 | | - | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
501 | 497 | | |
502 | 498 | | |
503 | 499 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
418 | | - | |
419 | | - | |
420 | | - | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
423 | 425 | | |
424 | 426 | | |
425 | | - | |
426 | | - | |
427 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
428 | 432 | | |
429 | 433 | | |
430 | 434 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
368 | 368 | | |
369 | 369 | | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
372 | 372 | | |
373 | | - | |
| 373 | + | |
374 | 374 | | |
375 | | - | |
| 375 | + | |
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| |||
0 commit comments