MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / test_same_origin

Function test_same_origin

libavformat/mov.c:5019–5046  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5017}
5018
5019static int test_same_origin(const char *src, const char *ref) {
5020 char src_proto[64];
5021 char ref_proto[64];
5022 char src_auth[256];
5023 char ref_auth[256];
5024 char src_host[256];
5025 char ref_host[256];
5026 int src_port=-1;
5027 int ref_port=-1;
5028
5029 av_url_split(src_proto, sizeof(src_proto), src_auth, sizeof(src_auth), src_host, sizeof(src_host), &src_port, NULL, 0, src);
5030 av_url_split(ref_proto, sizeof(ref_proto), ref_auth, sizeof(ref_auth), ref_host, sizeof(ref_host), &ref_port, NULL, 0, ref);
5031
5032 if (strlen(src) == 0) {
5033 return -1;
5034 } else if (strlen(src_auth) + 1 >= sizeof(src_auth) ||
5035 strlen(ref_auth) + 1 >= sizeof(ref_auth) ||
5036 strlen(src_host) + 1 >= sizeof(src_host) ||
5037 strlen(ref_host) + 1 >= sizeof(ref_host)) {
5038 return 0;
5039 } else if (strcmp(src_proto, ref_proto) ||
5040 strcmp(src_auth, ref_auth) ||
5041 strcmp(src_host, ref_host) ||
5042 src_port != ref_port) {
5043 return 0;
5044 } else
5045 return 1;
5046}
5047
5048static int mov_open_dref(MOVContext *c, AVIOContext **pb, const char *src, MOVDref *ref)
5049{

Callers 1

mov_open_drefFunction · 0.85

Calls 1

av_url_splitFunction · 0.85

Tested by

no test coverage detected