mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-10-31 16:47:28 +08:00
bug fixed
This commit is contained in:
parent
d955b639d7
commit
23e73f7c62
@ -228,22 +228,27 @@ bool RtspPlayer::handleAuthenticationFailure(const string ¶msStr) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
char realm[1024];
|
char *realm = new char[paramsStr.size()];
|
||||||
char nonce[1024];
|
char *nonce = new char[paramsStr.size()];
|
||||||
char stale[1024];
|
char *stale = new char[paramsStr.size()];
|
||||||
|
onceToken token(nullptr,[&](){
|
||||||
|
delete[] realm;
|
||||||
|
delete[] nonce;
|
||||||
|
delete[] stale;
|
||||||
|
});
|
||||||
|
|
||||||
if (sscanf(paramsStr.data(), "Digest realm=\"%[^\"]\", nonce=\"%[^\"]\", stale=%[a-zA-Z]", realm, nonce, stale) == 3) {
|
if (sscanf(paramsStr.data(), "Digest realm=\"%[^\"]\", nonce=\"%[^\"]\", stale=%[a-zA-Z]", realm, nonce, stale) == 3) {
|
||||||
(*this)[kRtspRealm] = realm;
|
(*this)[kRtspRealm] = (const char *)realm;
|
||||||
(*this)[kRtspMd5Nonce] = nonce;
|
(*this)[kRtspMd5Nonce] = (const char *)nonce;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (sscanf(paramsStr.data(), "Digest realm=\"%[^\"]\", nonce=\"%[^\"]\"", realm, nonce) == 2) {
|
if (sscanf(paramsStr.data(), "Digest realm=\"%[^\"]\", nonce=\"%[^\"]\"", realm, nonce) == 2) {
|
||||||
(*this)[kRtspRealm] = realm;
|
(*this)[kRtspRealm] = (const char *)realm;
|
||||||
(*this)[kRtspMd5Nonce] = nonce;
|
(*this)[kRtspMd5Nonce] = (const char *)nonce;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (sscanf(paramsStr.data(), "Basic realm=\"%[^\"]\"", realm) == 1) {
|
if (sscanf(paramsStr.data(), "Basic realm=\"%[^\"]\"", realm) == 1) {
|
||||||
(*this)[kRtspRealm] = realm;
|
(*this)[kRtspRealm] = (const char *)realm;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user