From 71c610d512fa349cb1d58d4500d4dd761d80b578 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Fri, 18 Mar 2016 15:57:08 -0700 Subject: [PATCH] Expand fuzzers --- Makefile | 99 ++++++++++++++++++ build.yaml | 36 +++++++ src/core/httpcli/parser.c | 14 ++- src/core/transport/chttp2/hpack_parser.c | 40 ++++--- src/core/transport/chttp2/hpack_table.c | 24 +++-- .../042dc4512fa3d391c5170cf3aa61e6a638f84342 | 1 + .../0e9bbe975f2027e8c39c89f85f667530368e7d11 | 1 + .../14b57bcbf1e17b1db1de491ef2ba3768f704b7dc | 1 + .../1794310671a060eead6e5ee66ac978a18ec7e84f | 2 + .../1d30b2a79afbaf2828ff42b9a9647e942ba1ab80 | 1 + .../1fcf5d9c333b70596cf5ba04d1f7affdf445b971 | 3 + .../23162c8a8936e20b195404c21337ee734d02a6bc | 1 + .../23f3198b815ca60bdadcaae682b9f965dda387f1 | 1 + .../2ef3893b43f1f60b77b59ce06a6bce9815d78eaf | 2 + .../356c3c129e203b5c74550b4209764d74b9caefce | 1 + .../3b58860f3451d3e7aad99690a8d39782ca5116fc | 4 + .../47b5228404451fc9d4071fa69192514bb4ce33c1 | 1 + .../636c5606fc23713a1bae88c8899c0541cfad4fd8 | 4 + .../63fe493b270b17426d77a27cbf3abac5b2c2794a | 1 + .../655300a902b62662296a8e46bfb04fbcb07182cb | 1 + .../6b70979a70a038ff6607d6cf85485ee95baf58e6 | 1 + .../7314ab3545a7535a26e0e8aad67caea5534d68b1 | 2 + .../884dcaee2908ffe5f12b65b8eba81016099c4266 | 1 + .../96c8d266b7dc037288ef305c996608270f72e7fb | 2 + .../975536c71ade4800415a7e9c2f1b45c35a6d5ea8 | 1 + .../99750aa67d30beaea8af565c829d4999aa8cb91b | 1 + .../a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de | 1 + .../a296eb3d1d436ed7df7195b10aa3c4de3896f98d | 1 + .../a8b8e66050b424f1b8c07d46f868199fb7f60e38 | 1 + .../af55baf8c8855e563befdf1eefbcbd46c5ddb8d2 | 1 + .../b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd | 1 + .../ceb4e2264ba7a8d5be47d276b37ec09489e00245 | 1 + .../cf4395958f5bfb46fd6f535a39657d016c75114c | 1 + .../d46668372b7e20154a89409a7430a28e642afdca | 1 + .../d6fe7412a0a1d1c733160246f3fa425f4f97682a | 1 + test/core/client_config/uri_corpus/dns.txt | 1 + .../ea02d9fea9bad5b89cf353a0169238f584177e71 | 4 + .../ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee | 1 + .../ed2f78646f19fc47dd85ff0877c232b71913ece2 | 1 + .../f6889f4a6350fea1596a3adea5cdac02bd5d1ff3 | 2 + .../f6f3bd030f0d321efe7c51ca3f057de23509af67 | 1 + .../f97598cff03306af3c70400608fec47268b5075d | 2 + .../f9e1ec1fc642b575bc9955618b7065747f56b101 | 1 + .../fe0630a3aeed2ec6f474f362e4c839478290d5c4 | 1 + test/core/client_config/uri_corpus/ipv4.txt | 1 + test/core/client_config/uri_corpus/ipv6.txt | 1 + test/core/client_config/uri_corpus/unix.txt | 1 + test/core/client_config/uri_fuzzer_test.c | 52 +++++++++ .../0299ca2580e4398d170c4a336e0c33eb2cd9d427 | 2 + .../05e613853d64a9669ea3cf41b0de777dc24931ba | 2 + .../069352518a1d1baa05f317c677d275cefda2ac97 | 2 + .../0c5b7c2569410b526605e308309a7f36574e530d | 4 + .../0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf | 3 + .../1e1273f90187fdf5df3625764245610f86af6aa4 | 3 + .../33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 | 2 + .../35f0c561297cfc840ddaeebb9fc61091f4eadece | 2 + .../39b19c41ba537f37511eff7727733715db432e76 | 2 + .../3e3c4756d5e40b5aa250954cbac86b826e70a7ac | 3 + .../3fb034e66ee5494a67acae1b4e6ff64ba92a2046 | 2 + .../487725eb38511c79a9340bf4560a1411061fa6fa | 2 + .../4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 | 2 + .../5028c56a5116a186b7343ff59567b47347a0796d | 3 + .../5b6292bdf009b0daecbc90b85cca30a88c36eec5 | 2 + .../657368df512ca6294b9df16adf935a3f374a8be2 | 3 + .../81f59a12b458ec3604035cb962165c604d1355e6 | 2 + .../8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 | 4 + .../97e4499d450c95660de86747f527e670f2012548 | 3 + .../aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 | 2 + .../b04fea5c041c707db0ad9c09a81672557b52cc47 | 2 + .../c55ce9995b002e88a102ae2891a71e8bacb346c8 | 2 + .../ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 | 3 + .../d4c3e4cf5d035596433c30eaabbd2b2925f4b453 | 3 + .../d936dad71c129cf659097dc3db64550c4dd467f4 | 2 + .../fc5d4b9117ba9e87388174aee4f4970bdfe8d066 | 1 + test/core/httpcli/corpus/response1.txt | 4 + test/core/httpcli/fuzzer.c | 50 +++++++++ .../0141fcddc9807ee093313b2256f1306fbbdc6cda | 1 + .../06995c2f3f01c7ec50547415dc324c64030b7a3e | Bin 0 -> 4 bytes .../06f7ce769fe07804fc842462d4be8c1aa2ba82c2 | 1 + .../0828169ba82152a8907f1001e3d98804397d4610 | 1 + .../0a10bd140c6c5fb109a0816ca061739688a6db9a | Bin 0 -> 24 bytes .../0c9996d4fef87bacd7a001e99a515b3ba3d5788f | Bin 0 -> 35 bytes .../0d6210208831fe55951af56cdeee3d54a91a5361 | 1 + .../0d784965b2262df7ed7a1eb57b92a718cc76bde8 | 1 + .../0e9196f951874edbb5ed098739ea5c8b6c0751c2 | Bin 0 -> 64 bytes .../1e8befb98cbaba059d6771abd1680e19484e7723 | Bin 0 -> 27 bytes .../311dac5092e36134d3490f98aa4207425e0ee941 | 1 + .../342ff1db70a7616b4ef76c03a42802c6702c18cb | 1 + .../38228bf98cdb50fd3fa830ba5a9d4c7399063dff | 1 + .../3a4bb427a85bdc5bf66ac71db073c99e0dc9f881 | 1 + .../3aec8d9311130dfbb6584fe6e619579c21992b5f | 1 + .../3c5af4d73e94d0e8ad5666b6acb340f929031e95 | 1 + .../3f8983e457033cc85997c356935ba9c21460e86b | 1 + .../4256437fc5897c0cd5d755816e4e68c7be326849 | Bin 0 -> 11 bytes .../471a307b81dc37459087d41532741c5c9d7ba836 | 1 + .../48bcce2c6487b18706ef0c609ca39c456215bac8 | 1 + .../4c7a034d3a3b4f29d99caf021a0e9bbb89706c2e | Bin 0 -> 64 bytes .../50b3f4b6aed97f442496d27f3b4315a18ba76d5f | 1 + .../51eff6fcbfe1a51ceb3f5f2140c01eea89b4313d | 1 + .../5653c44a5b520bdf2bdc599b7966f1d7c44950b3 | 1 + .../5a99df42fb7bbafa2d55714ee235b1c46776b2ad | 1 + .../5bab61eb53176449e25c2c82f172b82cb13ffb9d | 1 + .../65566df65e8f55428b6672cc351df414fa8f936c | 1 + .../65bb703af35d5afb824cd68c41d7a1aeb3848d35 | 1 + .../78176d80c1d74c4b1b820d386ae483ac4d1d92b7 | 1 + .../7a28fc2e9c72d51d29e87eed63ed405c9779b5e1 | 1 + .../7ba7239a29d6183960e3986abc8f19cfb548b905 | 1 + .../8057c32b8bd28a5ec2105d62f2abe8cf69c9f5fc | 1 + .../86bae059b18af8ae263e5ae0022b67da0cfc0fbe | 1 + .../8762a523cdb78d2344d553fa52a229bd63c44e51 | 1 + .../8fbbf3c0eaa25b64d0a97a8ee08006539e649199 | 1 + .../96903512b1f1dec08206123f024b62d0e31cd4dc | 1 + .../999821e3750a7f2c9db663d2d100b4404c225040 | 1 + .../99b2ed83be40cab431d1940e8de2dc3ebfe9352f | Bin 0 -> 47 bytes .../9e56bb3b68d2e2617cb2d2f0f3941f7fc832e462 | 1 + .../a871e7ce66afd4f57702cd1299de06cd08995561 | Bin 0 -> 31 bytes .../ac94b2788f5252f9e2e8502c7c75e04bef4c0b76 | 1 + .../af417c83e831a96fda1bdde99a1af6509ef2df3d | 1 + .../b0587e6e319f4b56d877e7ed46bc7da9b1e7249c | 1 + .../b244c690157ff21d073940ef8c77d1898f37cf8e | 1 + .../bcf4684ce097faa7e9d99b6e93cc2de24f57aee3 | Bin 0 -> 7 bytes .../ccd3b8aa26c52f6d9c607c26ebdf621142aff745 | Bin 0 -> 25 bytes .../d76d0c7f24ae3cc3f530d5306b8dcc15290c7ff2 | 1 + .../df01203edfa2dfe9e108ddde786ae48235624fef | Bin 0 -> 27 bytes .../e25adf8de44f5978d00b7e8c52aee89c5cd1fe93 | 1 + .../e29f05162e3d96d5549f96aa4a54c868535b2847 | 1 + .../e4ce52007d001806fc9368b62c124dfc56e8471c | 1 + .../eb48ebd4d01e5623dd16ae61938b3333fab3ce78 | 1 + .../eef2f30b5e2ecd98ebefb12d57aba8b4ad52d904 | 1 + .../ef23911de1a27d03d2d4983ca1527e17d6a7092b | 1 + .../ef5b7fc62a2daecf1e8f928b1fa3ebd028413a41 | Bin 0 -> 64 bytes .../efdd6824bd2456e3e408e0e84369c4fa3aa14f41 | 1 + .../efec040a5de1969df5e37e4bc50a0a8f0de341d8 | 1 + .../f4628084cf46f139babb886a782b4ab5977d5d2e | 1 + .../f7cf30724ab740918eee6e4a6b6658ae3d7706e8 | 1 + .../f823828ffd2a60efee36f1de52cb0f024ac5b4bb | 1 + .../fb15042c268625089ef6c8aa3d8a6f12d1d02c74 | 1 + .../chttp2/hpack_parser_fuzzer_test.c | 53 ++++++++++ .../runners/hpack_parser_fuzzer_test.sh | 32 ++++++ tools/fuzzer/runners/httpcli_fuzzer_test.sh | 32 ++++++ tools/fuzzer/runners/uri_fuzzer_test.sh | 32 ++++++ tools/run_tests/sources_and_headers.json | 48 +++++++++ 142 files changed, 662 insertions(+), 24 deletions(-) create mode 100644 test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f84342 create mode 100644 test/core/client_config/uri_corpus/0e9bbe975f2027e8c39c89f85f667530368e7d11 create mode 100644 test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc create mode 100644 test/core/client_config/uri_corpus/1794310671a060eead6e5ee66ac978a18ec7e84f create mode 100644 test/core/client_config/uri_corpus/1d30b2a79afbaf2828ff42b9a9647e942ba1ab80 create mode 100644 test/core/client_config/uri_corpus/1fcf5d9c333b70596cf5ba04d1f7affdf445b971 create mode 100644 test/core/client_config/uri_corpus/23162c8a8936e20b195404c21337ee734d02a6bc create mode 100644 test/core/client_config/uri_corpus/23f3198b815ca60bdadcaae682b9f965dda387f1 create mode 100644 test/core/client_config/uri_corpus/2ef3893b43f1f60b77b59ce06a6bce9815d78eaf create mode 100644 test/core/client_config/uri_corpus/356c3c129e203b5c74550b4209764d74b9caefce create mode 100644 test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc create mode 100644 test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c1 create mode 100644 test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd8 create mode 100644 test/core/client_config/uri_corpus/63fe493b270b17426d77a27cbf3abac5b2c2794a create mode 100644 test/core/client_config/uri_corpus/655300a902b62662296a8e46bfb04fbcb07182cb create mode 100644 test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e6 create mode 100644 test/core/client_config/uri_corpus/7314ab3545a7535a26e0e8aad67caea5534d68b1 create mode 100644 test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c4266 create mode 100644 test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb create mode 100644 test/core/client_config/uri_corpus/975536c71ade4800415a7e9c2f1b45c35a6d5ea8 create mode 100644 test/core/client_config/uri_corpus/99750aa67d30beaea8af565c829d4999aa8cb91b create mode 100644 test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de create mode 100644 test/core/client_config/uri_corpus/a296eb3d1d436ed7df7195b10aa3c4de3896f98d create mode 100644 test/core/client_config/uri_corpus/a8b8e66050b424f1b8c07d46f868199fb7f60e38 create mode 100644 test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d2 create mode 100644 test/core/client_config/uri_corpus/b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd create mode 100644 test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e00245 create mode 100644 test/core/client_config/uri_corpus/cf4395958f5bfb46fd6f535a39657d016c75114c create mode 100644 test/core/client_config/uri_corpus/d46668372b7e20154a89409a7430a28e642afdca create mode 100644 test/core/client_config/uri_corpus/d6fe7412a0a1d1c733160246f3fa425f4f97682a create mode 100644 test/core/client_config/uri_corpus/dns.txt create mode 100644 test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e71 create mode 100644 test/core/client_config/uri_corpus/ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee create mode 100644 test/core/client_config/uri_corpus/ed2f78646f19fc47dd85ff0877c232b71913ece2 create mode 100644 test/core/client_config/uri_corpus/f6889f4a6350fea1596a3adea5cdac02bd5d1ff3 create mode 100644 test/core/client_config/uri_corpus/f6f3bd030f0d321efe7c51ca3f057de23509af67 create mode 100644 test/core/client_config/uri_corpus/f97598cff03306af3c70400608fec47268b5075d create mode 100644 test/core/client_config/uri_corpus/f9e1ec1fc642b575bc9955618b7065747f56b101 create mode 100644 test/core/client_config/uri_corpus/fe0630a3aeed2ec6f474f362e4c839478290d5c4 create mode 100644 test/core/client_config/uri_corpus/ipv4.txt create mode 100644 test/core/client_config/uri_corpus/ipv6.txt create mode 100644 test/core/client_config/uri_corpus/unix.txt create mode 100644 test/core/client_config/uri_fuzzer_test.c create mode 100644 test/core/httpcli/corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 create mode 100644 test/core/httpcli/corpus/05e613853d64a9669ea3cf41b0de777dc24931ba create mode 100644 test/core/httpcli/corpus/069352518a1d1baa05f317c677d275cefda2ac97 create mode 100644 test/core/httpcli/corpus/0c5b7c2569410b526605e308309a7f36574e530d create mode 100644 test/core/httpcli/corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf create mode 100644 test/core/httpcli/corpus/1e1273f90187fdf5df3625764245610f86af6aa4 create mode 100644 test/core/httpcli/corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 create mode 100644 test/core/httpcli/corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece create mode 100644 test/core/httpcli/corpus/39b19c41ba537f37511eff7727733715db432e76 create mode 100644 test/core/httpcli/corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac create mode 100644 test/core/httpcli/corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 create mode 100644 test/core/httpcli/corpus/487725eb38511c79a9340bf4560a1411061fa6fa create mode 100644 test/core/httpcli/corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 create mode 100644 test/core/httpcli/corpus/5028c56a5116a186b7343ff59567b47347a0796d create mode 100644 test/core/httpcli/corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 create mode 100644 test/core/httpcli/corpus/657368df512ca6294b9df16adf935a3f374a8be2 create mode 100644 test/core/httpcli/corpus/81f59a12b458ec3604035cb962165c604d1355e6 create mode 100644 test/core/httpcli/corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 create mode 100644 test/core/httpcli/corpus/97e4499d450c95660de86747f527e670f2012548 create mode 100644 test/core/httpcli/corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 create mode 100644 test/core/httpcli/corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 create mode 100644 test/core/httpcli/corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 create mode 100644 test/core/httpcli/corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 create mode 100644 test/core/httpcli/corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 create mode 100644 test/core/httpcli/corpus/d936dad71c129cf659097dc3db64550c4dd467f4 create mode 100644 test/core/httpcli/corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 create mode 100644 test/core/httpcli/corpus/response1.txt create mode 100644 test/core/httpcli/fuzzer.c create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/0141fcddc9807ee093313b2256f1306fbbdc6cda create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/06995c2f3f01c7ec50547415dc324c64030b7a3e create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/06f7ce769fe07804fc842462d4be8c1aa2ba82c2 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/0828169ba82152a8907f1001e3d98804397d4610 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/0a10bd140c6c5fb109a0816ca061739688a6db9a create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/0c9996d4fef87bacd7a001e99a515b3ba3d5788f create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/0d6210208831fe55951af56cdeee3d54a91a5361 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/0d784965b2262df7ed7a1eb57b92a718cc76bde8 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/0e9196f951874edbb5ed098739ea5c8b6c0751c2 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/1e8befb98cbaba059d6771abd1680e19484e7723 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/311dac5092e36134d3490f98aa4207425e0ee941 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/342ff1db70a7616b4ef76c03a42802c6702c18cb create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/38228bf98cdb50fd3fa830ba5a9d4c7399063dff create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/3a4bb427a85bdc5bf66ac71db073c99e0dc9f881 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/3aec8d9311130dfbb6584fe6e619579c21992b5f create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/3c5af4d73e94d0e8ad5666b6acb340f929031e95 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/3f8983e457033cc85997c356935ba9c21460e86b create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/4256437fc5897c0cd5d755816e4e68c7be326849 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/471a307b81dc37459087d41532741c5c9d7ba836 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/48bcce2c6487b18706ef0c609ca39c456215bac8 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/4c7a034d3a3b4f29d99caf021a0e9bbb89706c2e create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/50b3f4b6aed97f442496d27f3b4315a18ba76d5f create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/51eff6fcbfe1a51ceb3f5f2140c01eea89b4313d create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/5653c44a5b520bdf2bdc599b7966f1d7c44950b3 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/5a99df42fb7bbafa2d55714ee235b1c46776b2ad create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/5bab61eb53176449e25c2c82f172b82cb13ffb9d create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/65566df65e8f55428b6672cc351df414fa8f936c create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/65bb703af35d5afb824cd68c41d7a1aeb3848d35 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/78176d80c1d74c4b1b820d386ae483ac4d1d92b7 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/7a28fc2e9c72d51d29e87eed63ed405c9779b5e1 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/7ba7239a29d6183960e3986abc8f19cfb548b905 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/8057c32b8bd28a5ec2105d62f2abe8cf69c9f5fc create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/86bae059b18af8ae263e5ae0022b67da0cfc0fbe create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/8762a523cdb78d2344d553fa52a229bd63c44e51 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/8fbbf3c0eaa25b64d0a97a8ee08006539e649199 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/96903512b1f1dec08206123f024b62d0e31cd4dc create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/999821e3750a7f2c9db663d2d100b4404c225040 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/99b2ed83be40cab431d1940e8de2dc3ebfe9352f create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/9e56bb3b68d2e2617cb2d2f0f3941f7fc832e462 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/a871e7ce66afd4f57702cd1299de06cd08995561 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/ac94b2788f5252f9e2e8502c7c75e04bef4c0b76 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/af417c83e831a96fda1bdde99a1af6509ef2df3d create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/b0587e6e319f4b56d877e7ed46bc7da9b1e7249c create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/b244c690157ff21d073940ef8c77d1898f37cf8e create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/bcf4684ce097faa7e9d99b6e93cc2de24f57aee3 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/ccd3b8aa26c52f6d9c607c26ebdf621142aff745 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/d76d0c7f24ae3cc3f530d5306b8dcc15290c7ff2 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/df01203edfa2dfe9e108ddde786ae48235624fef create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/e25adf8de44f5978d00b7e8c52aee89c5cd1fe93 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/e29f05162e3d96d5549f96aa4a54c868535b2847 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/e4ce52007d001806fc9368b62c124dfc56e8471c create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/eb48ebd4d01e5623dd16ae61938b3333fab3ce78 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/eef2f30b5e2ecd98ebefb12d57aba8b4ad52d904 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/ef23911de1a27d03d2d4983ca1527e17d6a7092b create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/ef5b7fc62a2daecf1e8f928b1fa3ebd028413a41 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/efdd6824bd2456e3e408e0e84369c4fa3aa14f41 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/efec040a5de1969df5e37e4bc50a0a8f0de341d8 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/f4628084cf46f139babb886a782b4ab5977d5d2e create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/f7cf30724ab740918eee6e4a6b6658ae3d7706e8 create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/f823828ffd2a60efee36f1de52cb0f024ac5b4bb create mode 100644 test/core/transport/chttp2/hpack_parser_corpus/fb15042c268625089ef6c8aa3d8a6f12d1d02c74 create mode 100644 test/core/transport/chttp2/hpack_parser_fuzzer_test.c create mode 100644 tools/fuzzer/runners/hpack_parser_fuzzer_test.sh create mode 100644 tools/fuzzer/runners/httpcli_fuzzer_test.sh create mode 100644 tools/fuzzer/runners/uri_fuzzer_test.sh diff --git a/Makefile b/Makefile index 2275f5698ba..0f8a10aa079 100644 --- a/Makefile +++ b/Makefile @@ -925,9 +925,11 @@ grpc_jwt_verifier_test: $(BINDIR)/$(CONFIG)/grpc_jwt_verifier_test grpc_print_google_default_creds_token: $(BINDIR)/$(CONFIG)/grpc_print_google_default_creds_token grpc_security_connector_test: $(BINDIR)/$(CONFIG)/grpc_security_connector_test grpc_verify_jwt: $(BINDIR)/$(CONFIG)/grpc_verify_jwt +hpack_parser_fuzzer_test: $(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test hpack_parser_test: $(BINDIR)/$(CONFIG)/hpack_parser_test hpack_table_test: $(BINDIR)/$(CONFIG)/hpack_table_test httpcli_format_request_test: $(BINDIR)/$(CONFIG)/httpcli_format_request_test +httpcli_fuzzer_test: $(BINDIR)/$(CONFIG)/httpcli_fuzzer_test httpcli_parser_test: $(BINDIR)/$(CONFIG)/httpcli_parser_test httpcli_test: $(BINDIR)/$(CONFIG)/httpcli_test httpscli_test: $(BINDIR)/$(CONFIG)/httpscli_test @@ -967,6 +969,7 @@ transport_connectivity_state_test: $(BINDIR)/$(CONFIG)/transport_connectivity_st transport_metadata_test: $(BINDIR)/$(CONFIG)/transport_metadata_test transport_security_test: $(BINDIR)/$(CONFIG)/transport_security_test udp_server_test: $(BINDIR)/$(CONFIG)/udp_server_test +uri_fuzzer_test: $(BINDIR)/$(CONFIG)/uri_fuzzer_test uri_parser_test: $(BINDIR)/$(CONFIG)/uri_parser_test workqueue_test: $(BINDIR)/$(CONFIG)/workqueue_test alarm_cpp_test: $(BINDIR)/$(CONFIG)/alarm_cpp_test @@ -7649,6 +7652,38 @@ endif endif +HPACK_PARSER_FUZZER_TEST_SRC = \ + test/core/transport/chttp2/hpack_parser_fuzzer_test.c \ + +HPACK_PARSER_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HPACK_PARSER_FUZZER_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test: $(HPACK_PARSER_FUZZER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(HPACK_PARSER_FUZZER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -lFuzzer -o $(BINDIR)/$(CONFIG)/hpack_parser_fuzzer_test + +endif + +$(OBJDIR)/$(CONFIG)/test/core/transport/chttp2/hpack_parser_fuzzer_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_hpack_parser_fuzzer_test: $(HPACK_PARSER_FUZZER_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(HPACK_PARSER_FUZZER_TEST_OBJS:.o=.dep) +endif +endif + + HPACK_PARSER_TEST_SRC = \ test/core/transport/chttp2/hpack_parser_test.c \ @@ -7745,6 +7780,38 @@ endif endif +HTTPCLI_FUZZER_TEST_SRC = \ + test/core/httpcli/fuzzer.c \ + +HTTPCLI_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(HTTPCLI_FUZZER_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/httpcli_fuzzer_test: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/httpcli_fuzzer_test: $(HTTPCLI_FUZZER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(HTTPCLI_FUZZER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -lFuzzer -o $(BINDIR)/$(CONFIG)/httpcli_fuzzer_test + +endif + +$(OBJDIR)/$(CONFIG)/test/core/httpcli/fuzzer.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_httpcli_fuzzer_test: $(HTTPCLI_FUZZER_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(HTTPCLI_FUZZER_TEST_OBJS:.o=.dep) +endif +endif + + HTTPCLI_PARSER_TEST_SRC = \ test/core/httpcli/parser_test.c \ @@ -8993,6 +9060,38 @@ endif endif +URI_FUZZER_TEST_SRC = \ + test/core/client_config/uri_fuzzer_test.c \ + +URI_FUZZER_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(URI_FUZZER_TEST_SRC)))) +ifeq ($(NO_SECURE),true) + +# You can't build secure targets if you don't have OpenSSL. + +$(BINDIR)/$(CONFIG)/uri_fuzzer_test: openssl_dep_error + +else + + + +$(BINDIR)/$(CONFIG)/uri_fuzzer_test: $(URI_FUZZER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + $(E) "[LD] Linking $@" + $(Q) mkdir -p `dirname $@` + $(Q) $(LDXX) $(LDFLAGS) $(URI_FUZZER_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -lFuzzer -o $(BINDIR)/$(CONFIG)/uri_fuzzer_test + +endif + +$(OBJDIR)/$(CONFIG)/test/core/client_config/uri_fuzzer_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a + +deps_uri_fuzzer_test: $(URI_FUZZER_TEST_OBJS:.o=.dep) + +ifneq ($(NO_SECURE),true) +ifneq ($(NO_DEPS),true) +-include $(URI_FUZZER_TEST_OBJS:.o=.dep) +endif +endif + + URI_PARSER_TEST_SRC = \ test/core/client_config/uri_parser_test.c \ diff --git a/build.yaml b/build.yaml index 7fa0ca7c6c8..6ada7e77e3a 100644 --- a/build.yaml +++ b/build.yaml @@ -1532,6 +1532,18 @@ targets: - grpc - gpr_test_util - gpr +- name: hpack_parser_fuzzer_test + build: fuzzer + language: c + src: + - test/core/transport/chttp2/hpack_parser_fuzzer_test.c + deps: + - grpc_test_util + - grpc + - gpr_test_util + - gpr + corpus_dirs: + - test/core/transport/chttp2/hpack_parser_corpus - name: hpack_parser_test build: test language: c @@ -1562,6 +1574,18 @@ targets: - grpc - gpr_test_util - gpr +- name: httpcli_fuzzer_test + build: fuzzer + language: c + src: + - test/core/httpcli/fuzzer.c + deps: + - grpc_test_util + - grpc + - gpr_test_util + - gpr + corpus_dirs: + - test/core/httpcli/corpus - name: httpcli_parser_test build: test language: c @@ -1993,6 +2017,18 @@ targets: - mac - linux - posix +- name: uri_fuzzer_test + build: fuzzer + language: c + src: + - test/core/client_config/uri_fuzzer_test.c + deps: + - grpc_test_util + - grpc + - gpr_test_util + - gpr + corpus_dirs: + - test/core/client_config/uri_corpus - name: uri_parser_test build: test language: c diff --git a/src/core/httpcli/parser.c b/src/core/httpcli/parser.c index c314f025a00..eb059e78040 100644 --- a/src/core/httpcli/parser.c +++ b/src/core/httpcli/parser.c @@ -39,6 +39,8 @@ #include #include +extern int grpc_http_trace; + static int handle_response_line(grpc_httpcli_parser *parser) { uint8_t *beg = parser->cur_line; uint8_t *cur = beg; @@ -65,7 +67,9 @@ static int handle_response_line(grpc_httpcli_parser *parser) { return 1; error: - gpr_log(GPR_ERROR, "Failed parsing response line"); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, "Failed parsing response line"); + } return 0; } @@ -85,7 +89,9 @@ static int add_header(grpc_httpcli_parser *parser) { GPR_ASSERT(cur != end); if (*cur == ' ' || *cur == '\t') { - gpr_log(GPR_ERROR, "Continued header lines not supported yet"); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, "Continued header lines not supported yet"); + } goto error; } @@ -93,7 +99,9 @@ static int add_header(grpc_httpcli_parser *parser) { cur++; } if (cur == end) { - gpr_log(GPR_ERROR, "Didn't find ':' in header string"); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, "Didn't find ':' in header string"); + } goto error; } GPR_ASSERT(cur >= beg); diff --git a/src/core/transport/chttp2/hpack_parser.c b/src/core/transport/chttp2/hpack_parser.c index a63c7db1f61..d0d2c7b42d3 100644 --- a/src/core/transport/chttp2/hpack_parser.c +++ b/src/core/transport/chttp2/hpack_parser.c @@ -34,9 +34,9 @@ #include "src/core/transport/chttp2/hpack_parser.h" #include "src/core/transport/chttp2/internal.h" +#include #include #include -#include /* This is here for grpc_is_binary_header * TODO(murgatroid99): Remove this @@ -52,6 +52,8 @@ #include "src/core/support/string.h" #include "src/core/transport/chttp2/bin_encoder.h" +extern int grpc_http_trace; + typedef enum { NOT_BINARY, B64_BYTE0, @@ -723,7 +725,9 @@ static int finish_indexed_field(grpc_chttp2_hpack_parser *p, const uint8_t *cur, const uint8_t *end) { grpc_mdelem *md = grpc_chttp2_hptbl_lookup(&p->table, p->index); if (md == NULL) { - gpr_log(GPR_ERROR, "Invalid HPACK index received: %d", p->index); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, "Invalid HPACK index received: %d", p->index); + } return 0; } GRPC_MDELEM_REF(md); @@ -919,7 +923,9 @@ static int parse_lithdr_nvridx_v(grpc_chttp2_hpack_parser *p, /* finish parsing a max table size change */ static int finish_max_tbl_size(grpc_chttp2_hpack_parser *p, const uint8_t *cur, const uint8_t *end) { - gpr_log(GPR_INFO, "MAX TABLE SIZE: %d", p->index); + if (grpc_http_trace) { + gpr_log(GPR_INFO, "MAX TABLE SIZE: %d", p->index); + } return grpc_chttp2_hptbl_set_current_table_size(&p->table, p->index) && parse_begin(p, cur, end); } @@ -960,7 +966,9 @@ static int parse_error(grpc_chttp2_hpack_parser *p, const uint8_t *cur, static int parse_illegal_op(grpc_chttp2_hpack_parser *p, const uint8_t *cur, const uint8_t *end) { GPR_ASSERT(cur != end); - gpr_log(GPR_DEBUG, "Illegal hpack op code %d", *cur); + if (grpc_http_trace) { + gpr_log(GPR_DEBUG, "Illegal hpack op code %d", *cur); + } return parse_error(p, cur, end); } @@ -1069,10 +1077,12 @@ static int parse_value4(grpc_chttp2_hpack_parser *p, const uint8_t *cur, } error: - gpr_log(GPR_ERROR, - "integer overflow in hpack integer decoding: have 0x%08x, " - "got byte 0x%02x on byte 5", - *p->parsing.value, *cur); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, + "integer overflow in hpack integer decoding: have 0x%08x, " + "got byte 0x%02x on byte 5", + *p->parsing.value, *cur); + } return parse_error(p, cur, end); } @@ -1094,10 +1104,12 @@ static int parse_value5up(grpc_chttp2_hpack_parser *p, const uint8_t *cur, return parse_next(p, cur + 1, end); } - gpr_log(GPR_ERROR, - "integer overflow in hpack integer decoding: have 0x%08x, " - "got byte 0x%02x sometime after byte 5", - *p->parsing.value, *cur); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, + "integer overflow in hpack integer decoding: have 0x%08x, " + "got byte 0x%02x sometime after byte 5", + *p->parsing.value, *cur); + } return parse_error(p, cur, end); } @@ -1329,7 +1341,9 @@ static is_binary_header is_binary_literal_header(grpc_chttp2_hpack_parser *p) { static is_binary_header is_binary_indexed_header(grpc_chttp2_hpack_parser *p) { grpc_mdelem *elem = grpc_chttp2_hptbl_lookup(&p->table, p->index); if (!elem) { - gpr_log(GPR_ERROR, "Invalid HPACK index received: %d", p->index); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, "Invalid HPACK index received: %d", p->index); + } return ERROR_HEADER; } return grpc_is_binary_header( diff --git a/src/core/transport/chttp2/hpack_table.c b/src/core/transport/chttp2/hpack_table.c index f1ce3b84fdc..54ac59e0568 100644 --- a/src/core/transport/chttp2/hpack_table.c +++ b/src/core/transport/chttp2/hpack_table.c @@ -41,6 +41,8 @@ #include "src/core/support/murmur_hash.h" +extern int grpc_http_trace; + static struct { const char *key; const char *value; @@ -264,12 +266,16 @@ int grpc_chttp2_hptbl_set_current_table_size(grpc_chttp2_hptbl *tbl, return 1; } if (bytes > tbl->max_bytes) { - gpr_log(GPR_ERROR, - "Attempt to make hpack table %d bytes when max is %d bytes", bytes, - tbl->max_bytes); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, + "Attempt to make hpack table %d bytes when max is %d bytes", + bytes, tbl->max_bytes); + } return 0; } - gpr_log(GPR_DEBUG, "Update hpack parser table size to %d", bytes); + if (grpc_http_trace) { + gpr_log(GPR_DEBUG, "Update hpack parser table size to %d", bytes); + } while (tbl->mem_used > bytes) { evict1(tbl); } @@ -293,10 +299,12 @@ int grpc_chttp2_hptbl_add(grpc_chttp2_hptbl *tbl, grpc_mdelem *md) { GRPC_CHTTP2_HPACK_ENTRY_OVERHEAD; if (tbl->current_table_bytes > tbl->max_bytes) { - gpr_log(GPR_ERROR, - "HPACK max table size reduced to %d but not reflected by hpack " - "stream (still at %d)", - tbl->max_bytes, tbl->current_table_bytes); + if (grpc_http_trace) { + gpr_log(GPR_ERROR, + "HPACK max table size reduced to %d but not reflected by hpack " + "stream (still at %d)", + tbl->max_bytes, tbl->current_table_bytes); + } return 0; } diff --git a/test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f84342 b/test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f84342 new file mode 100644 index 00000000000..597a6db294c --- /dev/null +++ b/test/core/client_config/uri_corpus/042dc4512fa3d391c5170cf3aa61e6a638f84342 @@ -0,0 +1 @@ +i \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/0e9bbe975f2027e8c39c89f85f667530368e7d11 b/test/core/client_config/uri_corpus/0e9bbe975f2027e8c39c89f85f667530368e7d11 new file mode 100644 index 00000000000..d56b8fc6c88 --- /dev/null +++ b/test/core/client_config/uri_corpus/0e9bbe975f2027e8c39c89f85f667530368e7d11 @@ -0,0 +1 @@ +:iiiÐ?+n!ij \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc b/test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc new file mode 100644 index 00000000000..3936e8964c5 --- /dev/null +++ b/test/core/client_config/uri_corpus/14b57bcbf1e17b1db1de491ef2ba3768f704b7dc @@ -0,0 +1 @@ +:‡i?=niI_!';ñ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/1794310671a060eead6e5ee66ac978a18ec7e84f b/test/core/client_config/uri_corpus/1794310671a060eead6e5ee66ac978a18ec7e84f new file mode 100644 index 00000000000..a94c4cf58dd --- /dev/null +++ b/test/core/client_config/uri_corpus/1794310671a060eead6e5ee66ac978a18ec7e84f @@ -0,0 +1,2 @@ +~ipip~6::1 +v:Ð:1 diff --git a/test/core/client_config/uri_corpus/1d30b2a79afbaf2828ff42b9a9647e942ba1ab80 b/test/core/client_config/uri_corpus/1d30b2a79afbaf2828ff42b9a9647e942ba1ab80 new file mode 100644 index 00000000000..875ac2a4f91 --- /dev/null +++ b/test/core/client_config/uri_corpus/1d30b2a79afbaf2828ff42b9a9647e942ba1ab80 @@ -0,0 +1 @@ +:il0P/8?n!$i: \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/1fcf5d9c333b70596cf5ba04d1f7affdf445b971 b/test/core/client_config/uri_corpus/1fcf5d9c333b70596cf5ba04d1f7affdf445b971 new file mode 100644 index 00000000000..59469af5285 --- /dev/null +++ b/test/core/client_config/uri_corpus/1fcf5d9c333b70596cf5ba04d1f7affdf445b971 @@ -0,0 +1,3 @@ +iiP*v:::pip~6:::0 +v:::11 + diff --git a/test/core/client_config/uri_corpus/23162c8a8936e20b195404c21337ee734d02a6bc b/test/core/client_config/uri_corpus/23162c8a8936e20b195404c21337ee734d02a6bc new file mode 100644 index 00000000000..2f902351bd8 --- /dev/null +++ b/test/core/client_config/uri_corpus/23162c8a8936e20b195404c21337ee734d02a6bc @@ -0,0 +1 @@ +:ii/i?n!%i* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/23f3198b815ca60bdadcaae682b9f965dda387f1 b/test/core/client_config/uri_corpus/23f3198b815ca60bdadcaae682b9f965dda387f1 new file mode 100644 index 00000000000..4bdc3f60c02 --- /dev/null +++ b/test/core/client_config/uri_corpus/23f3198b815ca60bdadcaae682b9f965dda387f1 @@ -0,0 +1 @@ +uni::.i?n(!ipR6/ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/2ef3893b43f1f60b77b59ce06a6bce9815d78eaf b/test/core/client_config/uri_corpus/2ef3893b43f1f60b77b59ce06a6bce9815d78eaf new file mode 100644 index 00000000000..fb7665d0ccb --- /dev/null +++ b/test/core/client_config/uri_corpus/2ef3893b43f1f60b77b59ce06a6bce9815d78eaf @@ -0,0 +1,2 @@ +:/i?n!ipv6:./::abc.* + diff --git a/test/core/client_config/uri_corpus/356c3c129e203b5c74550b4209764d74b9caefce b/test/core/client_config/uri_corpus/356c3c129e203b5c74550b4209764d74b9caefce new file mode 100644 index 00000000000..6c1e22fa32a --- /dev/null +++ b/test/core/client_config/uri_corpus/356c3c129e203b5c74550b4209764d74b9caefce @@ -0,0 +1 @@ +unix://ii:#v6i?n! \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc b/test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc new file mode 100644 index 00000000000..725b2086c5b --- /dev/null +++ b/test/core/client_config/uri_corpus/3b58860f3451d3e7aad99690a8d39782ca5116fc @@ -0,0 +1,4 @@ +i:i?nip~&2./:::abipip~6c.* + +::1 +v:Ð:1 diff --git a/test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c1 b/test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c1 new file mode 100644 index 00000000000..23d52e19a8a --- /dev/null +++ b/test/core/client_config/uri_corpus/47b5228404451fc9d4071fa69192514bb4ce33c1 @@ -0,0 +1 @@ +:iiP/i?n!'i* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd8 b/test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd8 new file mode 100644 index 00000000000..1dc4931ac6e --- /dev/null +++ b/test/core/client_config/uri_corpus/636c5606fc23713a1bae88c8899c0541cfad4fd8 @@ -0,0 +1,4 @@ +:i?n!ip~f2:./::abipip~6c.* + +::1 +v:Ð:1 diff --git a/test/core/client_config/uri_corpus/63fe493b270b17426d77a27cbf3abac5b2c2794a b/test/core/client_config/uri_corpus/63fe493b270b17426d77a27cbf3abac5b2c2794a new file mode 100644 index 00000000000..7b9532914e6 --- /dev/null +++ b/test/core/client_config/uri_corpus/63fe493b270b17426d77a27cbf3abac5b2c2794a @@ -0,0 +1 @@ +:‡i?=niI!';ñ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/655300a902b62662296a8e46bfb04fbcb07182cb b/test/core/client_config/uri_corpus/655300a902b62662296a8e46bfb04fbcb07182cb new file mode 100644 index 00000000000..4eaca392656 --- /dev/null +++ b/test/core/client_config/uri_corpus/655300a902b62662296a8e46bfb04fbcb07182cb @@ -0,0 +1 @@ +unix://ii:pv6i?n! \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e6 b/test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e6 new file mode 100644 index 00000000000..57cbd72dbcd --- /dev/null +++ b/test/core/client_config/uri_corpus/6b70979a70a038ff6607d6cf85485ee95baf58e6 @@ -0,0 +1 @@ +uni::/i?n!ipR6/ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/7314ab3545a7535a26e0e8aad67caea5534d68b1 b/test/core/client_config/uri_corpus/7314ab3545a7535a26e0e8aad67caea5534d68b1 new file mode 100644 index 00000000000..e13cf5a8e63 --- /dev/null +++ b/test/core/client_config/uri_corpus/7314ab3545a7535a26e0e8aad67caea5534d68b1 @@ -0,0 +1,2 @@ +ipip~6:::1 +v:::1 diff --git a/test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c4266 b/test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c4266 new file mode 100644 index 00000000000..58ecc7e2afa --- /dev/null +++ b/test/core/client_config/uri_corpus/884dcaee2908ffe5f12b65b8eba81016099c4266 @@ -0,0 +1 @@ +ip*v:::1 diff --git a/test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb b/test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb new file mode 100644 index 00000000000..efb392b7d99 --- /dev/null +++ b/test/core/client_config/uri_corpus/96c8d266b7dc037288ef305c996608270f72e7fb @@ -0,0 +1,2 @@ +:/i/n!ipv6:::/a.b.c1 + diff --git a/test/core/client_config/uri_corpus/975536c71ade4800415a7e9c2f1b45c35a6d5ea8 b/test/core/client_config/uri_corpus/975536c71ade4800415a7e9c2f1b45c35a6d5ea8 new file mode 100644 index 00000000000..71552225470 --- /dev/null +++ b/test/core/client_config/uri_corpus/975536c71ade4800415a7e9c2f1b45c35a6d5ea8 @@ -0,0 +1 @@ +ilP.i;?n!#i!; \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/99750aa67d30beaea8af565c829d4999aa8cb91b b/test/core/client_config/uri_corpus/99750aa67d30beaea8af565c829d4999aa8cb91b new file mode 100644 index 00000000000..4061e02189e --- /dev/null +++ b/test/core/client_config/uri_corpus/99750aa67d30beaea8af565c829d4999aa8cb91b @@ -0,0 +1 @@ +unix::/i?n!ipv6/ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de b/test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de new file mode 100644 index 00000000000..736e63e7e7e --- /dev/null +++ b/test/core/client_config/uri_corpus/a1f0f9b75bb354eb063d7cba4fcfa2d0b88d63de @@ -0,0 +1 @@ +:¢ilP/i;n!#i: \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/a296eb3d1d436ed7df7195b10aa3c4de3896f98d b/test/core/client_config/uri_corpus/a296eb3d1d436ed7df7195b10aa3c4de3896f98d new file mode 100644 index 00000000000..dff2f8920de --- /dev/null +++ b/test/core/client_config/uri_corpus/a296eb3d1d436ed7df7195b10aa3c4de3896f98d @@ -0,0 +1 @@ +u+ni::/i?n!ipR3/ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/a8b8e66050b424f1b8c07d46f868199fb7f60e38 b/test/core/client_config/uri_corpus/a8b8e66050b424f1b8c07d46f868199fb7f60e38 new file mode 100644 index 00000000000..13a115481d2 --- /dev/null +++ b/test/core/client_config/uri_corpus/a8b8e66050b424f1b8c07d46f868199fb7f60e38 @@ -0,0 +1 @@ +uni::pi:miP/?ni.!(Ri?)8/n!'i* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d2 b/test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d2 new file mode 100644 index 00000000000..fe019fc4091 --- /dev/null +++ b/test/core/client_config/uri_corpus/af55baf8c8855e563befdf1eefbcbd46c5ddb8d2 @@ -0,0 +1 @@ +uni::.i!in:/i/n!ipv6ž:?(pR;::/a.2b \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd b/test/core/client_config/uri_corpus/b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd new file mode 100644 index 00000000000..6e12167b521 --- /dev/null +++ b/test/core/client_config/uri_corpus/b3c0bf66c2bf5d24ef1daf4cc5a9d6d5bd0e8bfd @@ -0,0 +1 @@ +:ii/iilP.i;?n?n!#i!;!%* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e00245 b/test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e00245 new file mode 100644 index 00000000000..b5655220d74 --- /dev/null +++ b/test/core/client_config/uri_corpus/ceb4e2264ba7a8d5be47d276b37ec09489e00245 @@ -0,0 +1 @@ +:‡i?P-niI!'iñ \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/cf4395958f5bfb46fd6f535a39657d016c75114c b/test/core/client_config/uri_corpus/cf4395958f5bfb46fd6f535a39657d016c75114c new file mode 100644 index 00000000000..a7656724f51 --- /dev/null +++ b/test/core/client_config/uri_corpus/cf4395958f5bfb46fd6f535a39657d016c75114c @@ -0,0 +1 @@ +unix://ipv6::: \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/d46668372b7e20154a89409a7430a28e642afdca b/test/core/client_config/uri_corpus/d46668372b7e20154a89409a7430a28e642afdca new file mode 100644 index 00000000000..d658fb8ee09 --- /dev/null +++ b/test/core/client_config/uri_corpus/d46668372b7e20154a89409a7430a28e642afdca @@ -0,0 +1 @@ +:ilP/i?n!#i: \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/d6fe7412a0a1d1c733160246f3fa425f4f97682a b/test/core/client_config/uri_corpus/d6fe7412a0a1d1c733160246f3fa425f4f97682a new file mode 100644 index 00000000000..6d37b5fd450 --- /dev/null +++ b/test/core/client_config/uri_corpus/d6fe7412a0a1d1c733160246f3fa425f4f97682a @@ -0,0 +1 @@ +:ilP/i?n,!#i: \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/dns.txt b/test/core/client_config/uri_corpus/dns.txt new file mode 100644 index 00000000000..577e1054e4b --- /dev/null +++ b/test/core/client_config/uri_corpus/dns.txt @@ -0,0 +1 @@ +dns:10.2.1.1 diff --git a/test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e71 b/test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e71 new file mode 100644 index 00000000000..52f5a2382ac --- /dev/null +++ b/test/core/client_config/uri_corpus/ea02d9fea9bad5b89cf353a0169238f584177e71 @@ -0,0 +1,4 @@ +i:i?n!ip~f2.:/::abipip~6c.* + +::1 +v:Ð:1 diff --git a/test/core/client_config/uri_corpus/ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee b/test/core/client_config/uri_corpus/ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee new file mode 100644 index 00000000000..c3c93fed6af --- /dev/null +++ b/test/core/client_config/uri_corpus/ec4731dddf94ed3ea92ae4d5a71f145ab6e3f6ee @@ -0,0 +1 @@ +ii-i?n!%* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/ed2f78646f19fc47dd85ff0877c232b71913ece2 b/test/core/client_config/uri_corpus/ed2f78646f19fc47dd85ff0877c232b71913ece2 new file mode 100644 index 00000000000..45065e2f000 --- /dev/null +++ b/test/core/client_config/uri_corpus/ed2f78646f19fc47dd85ff0877c232b71913ece2 @@ -0,0 +1 @@ +:ii/i?n!%* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/f6889f4a6350fea1596a3adea5cdac02bd5d1ff3 b/test/core/client_config/uri_corpus/f6889f4a6350fea1596a3adea5cdac02bd5d1ff3 new file mode 100644 index 00000000000..02151c8b6af --- /dev/null +++ b/test/core/client_config/uri_corpus/f6889f4a6350fea1596a3adea5cdac02bd5d1ff3 @@ -0,0 +1,2 @@ +:ipip~6:::1 +vii/:::iunix:?n/1/ipv6!% \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/f6f3bd030f0d321efe7c51ca3f057de23509af67 b/test/core/client_config/uri_corpus/f6f3bd030f0d321efe7c51ca3f057de23509af67 new file mode 100644 index 00000000000..8034e133d7b --- /dev/null +++ b/test/core/client_config/uri_corpus/f6f3bd030f0d321efe7c51ca3f057de23509af67 @@ -0,0 +1 @@ +:iiP/i?n!i* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/f97598cff03306af3c70400608fec47268b5075d b/test/core/client_config/uri_corpus/f97598cff03306af3c70400608fec47268b5075d new file mode 100644 index 00000000000..240946dbaac --- /dev/null +++ b/test/core/client_config/uri_corpus/f97598cff03306af3c70400608fec47268b5075d @@ -0,0 +1,2 @@ +unix://ipv6:::/a.b.c1 + diff --git a/test/core/client_config/uri_corpus/f9e1ec1fc642b575bc9955618b7065747f56b101 b/test/core/client_config/uri_corpus/f9e1ec1fc642b575bc9955618b7065747f56b101 new file mode 100644 index 00000000000..d089a593462 --- /dev/null +++ b/test/core/client_config/uri_corpus/f9e1ec1fc642b575bc9955618b7065747f56b101 @@ -0,0 +1 @@ +:ilP.i;?n!#i; \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/fe0630a3aeed2ec6f474f362e4c839478290d5c4 b/test/core/client_config/uri_corpus/fe0630a3aeed2ec6f474f362e4c839478290d5c4 new file mode 100644 index 00000000000..66eefbcc14d --- /dev/null +++ b/test/core/client_config/uri_corpus/fe0630a3aeed2ec6f474f362e4c839478290d5c4 @@ -0,0 +1 @@ +:miP/i?)n!'i* \ No newline at end of file diff --git a/test/core/client_config/uri_corpus/ipv4.txt b/test/core/client_config/uri_corpus/ipv4.txt new file mode 100644 index 00000000000..fe29486b6e7 --- /dev/null +++ b/test/core/client_config/uri_corpus/ipv4.txt @@ -0,0 +1 @@ +ipv4:10.2.1.1 diff --git a/test/core/client_config/uri_corpus/ipv6.txt b/test/core/client_config/uri_corpus/ipv6.txt new file mode 100644 index 00000000000..7b6932be00b --- /dev/null +++ b/test/core/client_config/uri_corpus/ipv6.txt @@ -0,0 +1 @@ +ipv6:::1 diff --git a/test/core/client_config/uri_corpus/unix.txt b/test/core/client_config/uri_corpus/unix.txt new file mode 100644 index 00000000000..7a0997ec9a6 --- /dev/null +++ b/test/core/client_config/uri_corpus/unix.txt @@ -0,0 +1 @@ +unix:///a.b.c diff --git a/test/core/client_config/uri_fuzzer_test.c b/test/core/client_config/uri_fuzzer_test.c new file mode 100644 index 00000000000..f39288f1407 --- /dev/null +++ b/test/core/client_config/uri_fuzzer_test.c @@ -0,0 +1,52 @@ +/* + * + * Copyright 2015-2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include + +#include "src/core/client_config/uri_parser.h" + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + char *s = gpr_malloc(size + 1); + memcpy(s, data, size); + s[size] = 0; + + grpc_uri *x; + if ((x = grpc_uri_parse(s, 1))) { + grpc_uri_destroy(x); + } + gpr_free(s); + return 0; +} diff --git a/test/core/httpcli/corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 b/test/core/httpcli/corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 new file mode 100644 index 00000000000..3d6face56a0 --- /dev/null +++ b/test/core/httpcli/corpus/0299ca2580e4398d170c4a336e0c33eb2cd9d427 @@ -0,0 +1,2 @@ +HTTP/1.1 …200 OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/05e613853d64a9669ea3cf41b0de777dc24931ba b/test/core/httpcli/corpus/05e613853d64a9669ea3cf41b0de777dc24931ba new file mode 100644 index 00000000000..5cbaf2e460f --- /dev/null +++ b/test/core/httpcli/corpus/05e613853d64a9669ea3cf41b0de777dc24931ba @@ -0,0 +1,2 @@ +HTTP/1.1 8) pMKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/069352518a1d1baa05f317c677d275cefda2ac97 b/test/core/httpcli/corpus/069352518a1d1baa05f317c677d275cefda2ac97 new file mode 100644 index 00000000000..8831f0786bb --- /dev/null +++ b/test/core/httpcli/corpus/069352518a1d1baa05f317c677d275cefda2ac97 @@ -0,0 +1,2 @@ +HTTP/1.1 80) OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/0c5b7c2569410b526605e308309a7f36574e530d b/test/core/httpcli/corpus/0c5b7c2569410b526605e308309a7f36574e530d new file mode 100644 index 00000000000..c79e456904b --- /dev/null +++ b/test/core/httpcli/corpus/0c5b7c2569410b526605e308309a7f36574e530d @@ -0,0 +1,4 @@ +H TTP/16.1 200 OK +test: h!ello + +abcd diff --git a/test/core/httpcli/corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf b/test/core/httpcli/corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf new file mode 100644 index 00000000000..7b979b5e10f --- /dev/null +++ b/test/core/httpcli/corpus/0ef3d0a84360bb5ad66274f1226f5cb273ecdbcf @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH +tHTTP/01.021 Oes,H +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/1e1273f90187fdf5df3625764245610f86af6aa4 b/test/core/httpcli/corpus/1e1273f90187fdf5df3625764245610f86af6aa4 new file mode 100644 index 00000000000..67382b4f3af --- /dev/null +++ b/test/core/httpcli/corpus/1e1273f90187fdf5df3625764245610f86af6aa4 @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKHHTTP‰/1.200 OKH + +tHTHTTP/0 20T:tes/01. \ No newline at end of file diff --git a/test/core/httpcli/corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 b/test/core/httpcli/corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 new file mode 100644 index 00000000000..cce8ded71af --- /dev/null +++ b/test/core/httpcli/corpus/33f4ea0c7ea27c37d8f95cfa64d282370efdafd2 @@ -0,0 +1,2 @@ +HTTP/1*9y 200 OKm +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece b/test/core/httpcli/corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece new file mode 100644 index 00000000000..8df43e4dcee --- /dev/null +++ b/test/core/httpcli/corpus/35f0c561297cfc840ddaeebb9fc61091f4eadece @@ -0,0 +1,2 @@ +HTTP/1.9y 200 OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/39b19c41ba537f37511eff7727733715db432e76 b/test/core/httpcli/corpus/39b19c41ba537f37511eff7727733715db432e76 new file mode 100644 index 00000000000..fefa4512a87 --- /dev/null +++ b/test/core/httpcli/corpus/39b19c41ba537f37511eff7727733715db432e76 @@ -0,0 +1,2 @@ +HTTP/1.1 000 OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac b/test/core/httpcli/corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac new file mode 100644 index 00000000000..b967b57614d --- /dev/null +++ b/test/core/httpcli/corpus/3e3c4756d5e40b5aa250954cbac86b826e70a7ac @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH +tHTTP/01.021 : Oes,H +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 b/test/core/httpcli/corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 new file mode 100644 index 00000000000..7d20266703c --- /dev/null +++ b/test/core/httpcli/corpus/3fb034e66ee5494a67acae1b4e6ff64ba92a2046 @@ -0,0 +1,2 @@ +HTTP/1.1y 200 OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/487725eb38511c79a9340bf4560a1411061fa6fa b/test/core/httpcli/corpus/487725eb38511c79a9340bf4560a1411061fa6fa new file mode 100644 index 00000000000..c59c4d22466 --- /dev/null +++ b/test/core/httpcli/corpus/487725eb38511c79a9340bf4560a1411061fa6fa @@ -0,0 +1,2 @@ +HTTP/01.021 O,H +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 b/test/core/httpcli/corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 new file mode 100644 index 00000000000..49d1c8f1d2e --- /dev/null +++ b/test/core/httpcli/corpus/4b1f1f79a0bfa3f942479dd5f8edb59a7c257c55 @@ -0,0 +1,2 @@ +HTTP/1.1 200 OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/5028c56a5116a186b7343ff59567b47347a0796d b/test/core/httpcli/corpus/5028c56a5116a186b7343ff59567b47347a0796d new file mode 100644 index 00000000000..5f2c4dfef05 --- /dev/null +++ b/test/core/httpcli/corpus/5028c56a5116a186b7343ff59567b47347a0796d @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH + HTDP/01.021 : Oes,H +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 b/test/core/httpcli/corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 new file mode 100644 index 00000000000..9a15ab025fe --- /dev/null +++ b/test/core/httpcli/corpus/5b6292bdf009b0daecbc90b85cca30a88c36eec5 @@ -0,0 +1,2 @@ +HTTP/1. 200 OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/657368df512ca6294b9df16adf935a3f374a8be2 b/test/core/httpcli/corpus/657368df512ca6294b9df16adf935a3f374a8be2 new file mode 100644 index 00000000000..1f14f69103f --- /dev/null +++ b/test/core/httpcli/corpus/657368df512ca6294b9df16adf935a3f374a8be2 @@ -0,0 +1,3 @@ +HTT +/1.1 201 OKH +des \ No newline at end of file diff --git a/test/core/httpcli/corpus/81f59a12b458ec3604035cb962165c604d1355e6 b/test/core/httpcli/corpus/81f59a12b458ec3604035cb962165c604d1355e6 new file mode 100644 index 00000000000..d4223ccf818 --- /dev/null +++ b/test/core/httpcli/corpus/81f59a12b458ec3604035cb962165c604d1355e6 @@ -0,0 +1,2 @@ +HTTP/1.1 8p) )MKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 b/test/core/httpcli/corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 new file mode 100644 index 00000000000..99e2c48bbd4 --- /dev/null +++ b/test/core/httpcli/corpus/8f41c50e88ee8c17ecad3d41d63d38fb12aca0b9 @@ -0,0 +1,4 @@ +HTTP/1.1 200 OKH +tHTHTTP/1. 20TP/01.020(: Oes,H0 OKH + +tteses \ No newline at end of file diff --git a/test/core/httpcli/corpus/97e4499d450c95660de86747f527e670f2012548 b/test/core/httpcli/corpus/97e4499d450c95660de86747f527e670f2012548 new file mode 100644 index 00000000000..b1927fbf63d --- /dev/null +++ b/test/core/httpcli/corpus/97e4499d450c95660de86747f527e670f2012548 @@ -0,0 +1,3 @@ +HTHHTT`TT +/1.1 201 P*/OKH +des1.1 2T \ No newline at end of file diff --git a/test/core/httpcli/corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 b/test/core/httpcli/corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 new file mode 100644 index 00000000000..837449dda35 --- /dev/null +++ b/test/core/httpcli/corpus/aa3bbb876eafa8ad8ca4ff2eabc6dd94341d2441 @@ -0,0 +1,2 @@ +HTTP/1.1 80î OH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 b/test/core/httpcli/corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 new file mode 100644 index 00000000000..10905bed391 --- /dev/null +++ b/test/core/httpcli/corpus/b04fea5c041c707db0ad9c09a81672557b52cc47 @@ -0,0 +1,2 @@ +JHTTP/1.1 200 OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 b/test/core/httpcli/corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 new file mode 100644 index 00000000000..2704e4fb392 --- /dev/null +++ b/test/core/httpcli/corpus/c55ce9995b002e88a102ae2891a71e8bacb346c8 @@ -0,0 +1,2 @@ +HTTP/1.1 767) OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 b/test/core/httpcli/corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 new file mode 100644 index 00000000000..f5cbbc69e78 --- /dev/null +++ b/test/core/httpcli/corpus/ca5a0c00b8969310acb73d15ad0d0c602f1bd0c2 @@ -0,0 +1,3 @@ +HJHTHHTT`TT +/1.1 201 P*HHTT/T1/OKH +des1.1 2.1T 20T1 \ No newline at end of file diff --git a/test/core/httpcli/corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 b/test/core/httpcli/corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 new file mode 100644 index 00000000000..be33d81102f --- /dev/null +++ b/test/core/httpcli/corpus/d4c3e4cf5d035596433c30eaabbd2b2925f4b453 @@ -0,0 +1,3 @@ +HTTP/1.1 200 OKH + HTTP/01.021 : Oes,H +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/d936dad71c129cf659097dc3db64550c4dd467f4 b/test/core/httpcli/corpus/d936dad71c129cf659097dc3db64550c4dd467f4 new file mode 100644 index 00000000000..ccf918751dc --- /dev/null +++ b/test/core/httpcli/corpus/d936dad71c129cf659097dc3db64550c4dd467f4 @@ -0,0 +1,2 @@ +HTTP‰/1.200 OKH +tes \ No newline at end of file diff --git a/test/core/httpcli/corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 b/test/core/httpcli/corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 new file mode 100644 index 00000000000..06f1a3b8002 --- /dev/null +++ b/test/core/httpcli/corpus/fc5d4b9117ba9e87388174aee4f4970bdfe8d066 @@ -0,0 +1 @@ +HH \ No newline at end of file diff --git a/test/core/httpcli/corpus/response1.txt b/test/core/httpcli/corpus/response1.txt new file mode 100644 index 00000000000..a17139982e7 --- /dev/null +++ b/test/core/httpcli/corpus/response1.txt @@ -0,0 +1,4 @@ +HTTP/1.1 200 OK +test: hello + +abcd diff --git a/test/core/httpcli/fuzzer.c b/test/core/httpcli/fuzzer.c new file mode 100644 index 00000000000..ff960484db5 --- /dev/null +++ b/test/core/httpcli/fuzzer.c @@ -0,0 +1,50 @@ +/* + * + * Copyright 2015-2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include +#include + +#include + +#include "src/core/httpcli/parser.h" + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + grpc_httpcli_parser parser; + grpc_httpcli_parser_init(&parser); + gpr_slice slice = gpr_slice_from_copied_buffer((const char *)data, size); + grpc_httpcli_parser_parse(&parser, slice); + grpc_httpcli_parser_eof(&parser); + gpr_slice_unref(slice); + grpc_httpcli_parser_destroy(&parser); + return 0; +} diff --git a/test/core/transport/chttp2/hpack_parser_corpus/0141fcddc9807ee093313b2256f1306fbbdc6cda b/test/core/transport/chttp2/hpack_parser_corpus/0141fcddc9807ee093313b2256f1306fbbdc6cda new file mode 100644 index 00000000000..76b12506256 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/0141fcddc9807ee093313b2256f1306fbbdc6cda @@ -0,0 +1 @@ +(?¤¤¤Û¤Ûð \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/06995c2f3f01c7ec50547415dc324c64030b7a3e b/test/core/transport/chttp2/hpack_parser_corpus/06995c2f3f01c7ec50547415dc324c64030b7a3e new file mode 100644 index 0000000000000000000000000000000000000000..be20eb55defbcc12791ab47ff111d7777e72df99 GIT binary patch literal 4 LcmdO6Sdt6?0%rj> literal 0 HcmV?d00001 diff --git a/test/core/transport/chttp2/hpack_parser_corpus/06f7ce769fe07804fc842462d4be8c1aa2ba82c2 b/test/core/transport/chttp2/hpack_parser_corpus/06f7ce769fe07804fc842462d4be8c1aa2ba82c2 new file mode 100644 index 00000000000..0edc9f996f6 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/06f7ce769fe07804fc842462d4be8c1aa2ba82c2 @@ -0,0 +1 @@ +®€¤ˆ(cc \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/0828169ba82152a8907f1001e3d98804397d4610 b/test/core/transport/chttp2/hpack_parser_corpus/0828169ba82152a8907f1001e3d98804397d4610 new file mode 100644 index 00000000000..af778fb8af4 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/0828169ba82152a8907f1001e3d98804397d4610 @@ -0,0 +1 @@ +¤¤Ûð!ð cc' \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/0a10bd140c6c5fb109a0816ca061739688a6db9a b/test/core/transport/chttp2/hpack_parser_corpus/0a10bd140c6c5fb109a0816ca061739688a6db9a new file mode 100644 index 0000000000000000000000000000000000000000..94a69970223d4ff8021cf199586d1b29853446e2 GIT binary patch literal 24 fcmdN|uw)$v1G~VNXbnZqlHTEa6~Ce(L@=IoS#T%cKkl literal 0 HcmV?d00001 diff --git a/test/core/transport/chttp2/hpack_parser_corpus/0d6210208831fe55951af56cdeee3d54a91a5361 b/test/core/transport/chttp2/hpack_parser_corpus/0d6210208831fe55951af56cdeee3d54a91a5361 new file mode 100644 index 00000000000..001fd0bc880 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/0d6210208831fe55951af56cdeee3d54a91a5361 @@ -0,0 +1 @@ +f!(!! i[Ñ!å \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/0d784965b2262df7ed7a1eb57b92a718cc76bde8 b/test/core/transport/chttp2/hpack_parser_corpus/0d784965b2262df7ed7a1eb57b92a718cc76bde8 new file mode 100644 index 00000000000..398077e307c --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/0d784965b2262df7ed7a1eb57b92a718cc76bde8 @@ -0,0 +1 @@ +¤Ê!ð c' \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/0e9196f951874edbb5ed098739ea5c8b6c0751c2 b/test/core/transport/chttp2/hpack_parser_corpus/0e9196f951874edbb5ed098739ea5c8b6c0751c2 new file mode 100644 index 0000000000000000000000000000000000000000..8a3ef9ea824f1282c70774112333c6ec4171be4e GIT binary patch literal 64 zcmV-G0Kfn6TPPtR2_fZ2{Xr=xAt~)4yecW#Iy;AoD%Hd8DETQ}C@4E8Cp(rU?nY~b Wko7YuC(|j)(L*XJoRt76DDY(mE*Uxi literal 0 HcmV?d00001 diff --git a/test/core/transport/chttp2/hpack_parser_corpus/50b3f4b6aed97f442496d27f3b4315a18ba76d5f b/test/core/transport/chttp2/hpack_parser_corpus/50b3f4b6aed97f442496d27f3b4315a18ba76d5f new file mode 100644 index 00000000000..e2e8f9b231b --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/50b3f4b6aed97f442496d27f3b4315a18ba76d5f @@ -0,0 +1 @@ +;;? \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/51eff6fcbfe1a51ceb3f5f2140c01eea89b4313d b/test/core/transport/chttp2/hpack_parser_corpus/51eff6fcbfe1a51ceb3f5f2140c01eea89b4313d new file mode 100644 index 00000000000..b26118fd841 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/51eff6fcbfe1a51ceb3f5f2140c01eea89b4313d @@ -0,0 +1 @@ +¤¤Ûððƒcc' \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/5653c44a5b520bdf2bdc599b7966f1d7c44950b3 b/test/core/transport/chttp2/hpack_parser_corpus/5653c44a5b520bdf2bdc599b7966f1d7c44950b3 new file mode 100644 index 00000000000..463f1a40fb0 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/5653c44a5b520bdf2bdc599b7966f1d7c44950b3 @@ -0,0 +1 @@ +¤ \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/5a99df42fb7bbafa2d55714ee235b1c46776b2ad b/test/core/transport/chttp2/hpack_parser_corpus/5a99df42fb7bbafa2d55714ee235b1c46776b2ad new file mode 100644 index 00000000000..198c062d33a --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/5a99df42fb7bbafa2d55714ee235b1c46776b2ad @@ -0,0 +1 @@ +¤[ð!ð c' \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/5bab61eb53176449e25c2c82f172b82cb13ffb9d b/test/core/transport/chttp2/hpack_parser_corpus/5bab61eb53176449e25c2c82f172b82cb13ffb9d new file mode 100644 index 00000000000..0d758c9c7bc --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/5bab61eb53176449e25c2c82f172b82cb13ffb9d @@ -0,0 +1 @@ +? \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/65566df65e8f55428b6672cc351df414fa8f936c b/test/core/transport/chttp2/hpack_parser_corpus/65566df65e8f55428b6672cc351df414fa8f936c new file mode 100644 index 00000000000..a273e997885 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/65566df65e8f55428b6672cc351df414fa8f936c @@ -0,0 +1 @@ +'ð[(!! ð[(!! !åGý!åGýA)(!)í!¼)Ù:;‡Š* \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/65bb703af35d5afb824cd68c41d7a1aeb3848d35 b/test/core/transport/chttp2/hpack_parser_corpus/65bb703af35d5afb824cd68c41d7a1aeb3848d35 new file mode 100644 index 00000000000..8ac429215fe --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/65bb703af35d5afb824cd68c41d7a1aeb3848d35 @@ -0,0 +1 @@ +[ð!ð '(![(!! !åGý!åGýA)(!)í!¼)Ù:;‡Š* \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/78176d80c1d74c4b1b820d386ae483ac4d1d92b7 b/test/core/transport/chttp2/hpack_parser_corpus/78176d80c1d74c4b1b820d386ae483ac4d1d92b7 new file mode 100644 index 00000000000..e9dc85e59cc --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/78176d80c1d74c4b1b820d386ae483ac4d1d92b7 @@ -0,0 +1 @@ +(?¤›ð! c \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/7a28fc2e9c72d51d29e87eed63ed405c9779b5e1 b/test/core/transport/chttp2/hpack_parser_corpus/7a28fc2e9c72d51d29e87eed63ed405c9779b5e1 new file mode 100644 index 00000000000..ad5695bc9ad --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/7a28fc2e9c72d51d29e87eed63ed405c9779b5e1 @@ -0,0 +1 @@ +¤¤Ûððƒ€cc' \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/7ba7239a29d6183960e3986abc8f19cfb548b905 b/test/core/transport/chttp2/hpack_parser_corpus/7ba7239a29d6183960e3986abc8f19cfb548b905 new file mode 100644 index 00000000000..8985a0765aa --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/7ba7239a29d6183960e3986abc8f19cfb548b905 @@ -0,0 +1 @@ +¤!ƒÛððcc' \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/8057c32b8bd28a5ec2105d62f2abe8cf69c9f5fc b/test/core/transport/chttp2/hpack_parser_corpus/8057c32b8bd28a5ec2105d62f2abe8cf69c9f5fc new file mode 100644 index 00000000000..a38435872b0 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/8057c32b8bd28a5ec2105d62f2abe8cf69c9f5fc @@ -0,0 +1 @@ +f!(!!c' i[Ñ!ð[(!! ð[(!! !åHý![(!! !åGýåA)(!)í!¼*)åGýA)(Ù!)Š \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/86bae059b18af8ae263e5ae0022b67da0cfc0fbe b/test/core/transport/chttp2/hpack_parser_corpus/86bae059b18af8ae263e5ae0022b67da0cfc0fbe new file mode 100644 index 00000000000..fc8f2aea186 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/86bae059b18af8ae263e5ae0022b67da0cfc0fbe @@ -0,0 +1 @@ +¤ÿ \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/8762a523cdb78d2344d553fa52a229bd63c44e51 b/test/core/transport/chttp2/hpack_parser_corpus/8762a523cdb78d2344d553fa52a229bd63c44e51 new file mode 100644 index 00000000000..e92f115945c --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/8762a523cdb78d2344d553fa52a229bd63c44e51 @@ -0,0 +1 @@ +¤ \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/8fbbf3c0eaa25b64d0a97a8ee08006539e649199 b/test/core/transport/chttp2/hpack_parser_corpus/8fbbf3c0eaa25b64d0a97a8ee08006539e649199 new file mode 100644 index 00000000000..532ee696019 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/8fbbf3c0eaa25b64d0a97a8ee08006539e649199 @@ -0,0 +1 @@ +¤c \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/96903512b1f1dec08206123f024b62d0e31cd4dc b/test/core/transport/chttp2/hpack_parser_corpus/96903512b1f1dec08206123f024b62d0e31cd4dc new file mode 100644 index 00000000000..b8c71bd5cdb --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/96903512b1f1dec08206123f024b62d0e31cd4dc @@ -0,0 +1 @@ +cð[(! ð[(!\ !åGý![(!! !åGýA)(!)í!¸*)åGýA)(Ù;)Š \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/999821e3750a7f2c9db663d2d100b4404c225040 b/test/core/transport/chttp2/hpack_parser_corpus/999821e3750a7f2c9db663d2d100b4404c225040 new file mode 100644 index 00000000000..eafc76571c7 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/999821e3750a7f2c9db663d2d100b4404c225040 @@ -0,0 +1 @@ +[(!! ![ð!å \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/99b2ed83be40cab431d1940e8de2dc3ebfe9352f b/test/core/transport/chttp2/hpack_parser_corpus/99b2ed83be40cab431d1940e8de2dc3ebfe9352f new file mode 100644 index 0000000000000000000000000000000000000000..168a2155962cc73109e585baa5337e089528b76a GIT binary patch literal 47 zcmV+~0MP#oq#vX^+v4yEV=e%sDr2Ceu44!%01yZ8TPPt3WAG>;TnQndqzC|G+s)5m^8L literal 0 HcmV?d00001 diff --git a/test/core/transport/chttp2/hpack_parser_corpus/9e56bb3b68d2e2617cb2d2f0f3941f7fc832e462 b/test/core/transport/chttp2/hpack_parser_corpus/9e56bb3b68d2e2617cb2d2f0f3941f7fc832e462 new file mode 100644 index 00000000000..ac4416657c8 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/9e56bb3b68d2e2617cb2d2f0f3941f7fc832e462 @@ -0,0 +1 @@ +c'ð[(!! ð[(!! !åGý![(!! !åGýA)(!)í!¼*)åGýA)(Ù!)Š \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/a871e7ce66afd4f57702cd1299de06cd08995561 b/test/core/transport/chttp2/hpack_parser_corpus/a871e7ce66afd4f57702cd1299de06cd08995561 new file mode 100644 index 0000000000000000000000000000000000000000..59295acbf7955382684033362492806afe8bab0d GIT binary patch literal 31 jcmdN|uw)$v1G~VNXbnZq4o0RU@~2*CgV literal 0 HcmV?d00001 diff --git a/test/core/transport/chttp2/hpack_parser_corpus/d76d0c7f24ae3cc3f530d5306b8dcc15290c7ff2 b/test/core/transport/chttp2/hpack_parser_corpus/d76d0c7f24ae3cc3f530d5306b8dcc15290c7ff2 new file mode 100644 index 00000000000..81cc0fcbfb8 --- /dev/null +++ b/test/core/transport/chttp2/hpack_parser_corpus/d76d0c7f24ae3cc3f530d5306b8dcc15290c7ff2 @@ -0,0 +1 @@ +¤ä— \ No newline at end of file diff --git a/test/core/transport/chttp2/hpack_parser_corpus/df01203edfa2dfe9e108ddde786ae48235624fef b/test/core/transport/chttp2/hpack_parser_corpus/df01203edfa2dfe9e108ddde786ae48235624fef new file mode 100644 index 0000000000000000000000000000000000000000..a4520fbd22277b2a51bfa33b25fc49f82ff66bfb GIT binary patch literal 27 jcmdN|uw +#include + +#include +#include + +#include "src/core/transport/chttp2/hpack_parser.h" + +static void onhdr(void *ud, grpc_mdelem *md) { GRPC_MDELEM_UNREF(md); } + +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { + grpc_init(); + grpc_chttp2_hpack_parser parser; + grpc_chttp2_hpack_parser_init(&parser); + parser.on_header = onhdr; + grpc_chttp2_hpack_parser_parse(&parser, data, data + size); + grpc_chttp2_hpack_parser_destroy(&parser); + grpc_shutdown(); + return 0; +} diff --git a/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh b/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh new file mode 100644 index 00000000000..932b69e8ce7 --- /dev/null +++ b/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +bins/$config/hpack_parser_fuzzer_test -max_total_time=60 fuzzer_output test/core/transport/chttp2/hpack_parser_corpus diff --git a/tools/fuzzer/runners/httpcli_fuzzer_test.sh b/tools/fuzzer/runners/httpcli_fuzzer_test.sh new file mode 100644 index 00000000000..c4b577879f1 --- /dev/null +++ b/tools/fuzzer/runners/httpcli_fuzzer_test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +bins/$config/httpcli_fuzzer_test -max_total_time=60 fuzzer_output test/core/httpcli/corpus diff --git a/tools/fuzzer/runners/uri_fuzzer_test.sh b/tools/fuzzer/runners/uri_fuzzer_test.sh new file mode 100644 index 00000000000..2da8d29d892 --- /dev/null +++ b/tools/fuzzer/runners/uri_fuzzer_test.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Copyright 2016, Google Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# + +bins/$config/uri_fuzzer_test -max_total_time=60 fuzzer_output test/core/client_config/uri_corpus diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index d1e660698b6..5ebf6666e88 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -882,6 +882,22 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "hpack_parser_fuzzer_test", + "src": [ + "test/core/transport/chttp2/hpack_parser_fuzzer_test.c" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr", @@ -930,6 +946,22 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "httpcli_fuzzer_test", + "src": [ + "test/core/httpcli/fuzzer.c" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr", @@ -1551,6 +1583,22 @@ "third_party": false, "type": "target" }, + { + "deps": [ + "gpr", + "gpr_test_util", + "grpc", + "grpc_test_util" + ], + "headers": [], + "language": "c", + "name": "uri_fuzzer_test", + "src": [ + "test/core/client_config/uri_fuzzer_test.c" + ], + "third_party": false, + "type": "target" + }, { "deps": [ "gpr",