Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(578)

Unified Diff: webrtc/test/fuzzers/sdp_parser_fuzzer.cc

Issue 2044523002: Add fuzzers for SDP and STUN parsing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Updates as per code review Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/test/fuzzers/BUILD.gn ('k') | webrtc/test/fuzzers/stun_parser_fuzzer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/fuzzers/sdp_parser_fuzzer.cc
diff --git a/webrtc/test/fuzzers/rtp_packet_fuzzer.cc b/webrtc/test/fuzzers/sdp_parser_fuzzer.cc
similarity index 62%
copy from webrtc/test/fuzzers/rtp_packet_fuzzer.cc
copy to webrtc/test/fuzzers/sdp_parser_fuzzer.cc
index a9efdb96ecfe4f7a77873f54edbb55108c9497f9..f21c991a3e1da9983514f636400e22cf9c989c9d 100644
--- a/webrtc/test/fuzzers/rtp_packet_fuzzer.cc
+++ b/webrtc/test/fuzzers/sdp_parser_fuzzer.cc
@@ -7,23 +7,19 @@
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "webrtc/modules/rtp_rtcp/source/rtp_packet_received.h"
-namespace webrtc {
+#include <stddef.h>
+#include <stdint.h>
-void FuzzOneInput(const uint8_t* data, size_t size) {
- RtpPacketReceived packet;
+#include "webrtc/api/jsepsessiondescription.h"
- packet.Parse(data, size);
+namespace webrtc {
+void FuzzOneInput(const uint8_t* data, size_t size) {
+ std::string message(reinterpret_cast<const char*>(data), size);
+ webrtc::SdpParseError error;
- // Call packet accessors because they have extra checks.
- packet.Marker();
- packet.PayloadType();
- packet.SequenceNumber();
- packet.Timestamp();
- packet.Ssrc();
- packet.Csrcs();
+ std::unique_ptr<webrtc::SessionDescriptionInterface> sdp(
+ CreateSessionDescription("offer", message, &error));
}
} // namespace webrtc
-
« no previous file with comments | « webrtc/test/fuzzers/BUILD.gn ('k') | webrtc/test/fuzzers/stun_parser_fuzzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698