[bt][sdp] Fix buffer size check, max response size

Calculate the size of the response buffers that are being parsed in
ServiceSearchResponse, ServiceAttributeResponse, and
ServiceSearchAttributeResponse correctly before parsing the results.

Fix a problem where continuing to parse continuation packets for
ServiceAttributeResponse and ServiceSearchAttributeResponse could have
an unbounded memory allocation.

Fixed: 50628
Fixed: 50627
Test: bt-host-unittests, updated SDP parsing tests.

Multiply: bt-host-unittests:30
Change-Id: Iaa36d69620f2374de3549217b43fc43a8404e0e6
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/384686
Reviewed-by: Ani Ramakrishnan <aniramakri@google.com>
Testability-Review: Ani Ramakrishnan <aniramakri@google.com>
Commit-Queue: Marie Janssen 💖 <jamuraa@google.com>
2 files changed
tree: 6f584a4e334570f7a633f9b4ad02e0243878b42e
  1. .clang-format
  2. .clang-tidy
  3. .dir-locals.el
  4. .gitattributes
  5. .gitignore
  6. .gn
  7. .style.yapf
  8. AUTHORS
  9. BUILD.gn
  10. CODE_OF_CONDUCT.md
  11. CONTRIBUTING.md
  12. LICENSE
  13. OWNERS
  14. PATENTS
  15. README.md
  16. boards/
  17. build/
  18. bundles/
  19. docs/
  20. examples/
  21. garnet/
  22. products/
  23. rustfmt.toml
  24. scripts/
  25. sdk/
  26. src/
  27. third_party/
  28. tools/
  29. zircon/
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.