properly null check ufrag and pwd before whitespace checking. fixes #3956
This commit is contained in:
parent
8eb685a7eb
commit
2bec5459c5
|
@ -77,7 +77,7 @@ public class FileBackend {
|
||||||
|
|
||||||
private static final String FILE_PROVIDER = ".files";
|
private static final String FILE_PROVIDER = ".files";
|
||||||
private static final float IGNORE_PADDING = 0.15f;
|
private static final float IGNORE_PADDING = 0.15f;
|
||||||
private XmppConnectionService mXmppConnectionService;
|
private final XmppConnectionService mXmppConnectionService;
|
||||||
|
|
||||||
public FileBackend(XmppConnectionService service) {
|
public FileBackend(XmppConnectionService service) {
|
||||||
this.mXmppConnectionService = service;
|
this.mXmppConnectionService = service;
|
||||||
|
|
|
@ -143,14 +143,16 @@ public class SessionDescription {
|
||||||
final ArrayListMultimap<String, String> mediaAttributes = ArrayListMultimap.create();
|
final ArrayListMultimap<String, String> mediaAttributes = ArrayListMultimap.create();
|
||||||
final String ufrag = transport.getAttribute("ufrag");
|
final String ufrag = transport.getAttribute("ufrag");
|
||||||
final String pwd = transport.getAttribute("pwd");
|
final String pwd = transport.getAttribute("pwd");
|
||||||
if (!Strings.isNullOrEmpty(ufrag)) {
|
if (Strings.isNullOrEmpty(ufrag)) {
|
||||||
mediaAttributes.put("ice-ufrag", ufrag);
|
throw new IllegalArgumentException("Transport element is missing required ufrag attribute");
|
||||||
}
|
}
|
||||||
checkNoWhitespace(ufrag, "ufrag value must not contain any whitespaces");
|
checkNoWhitespace(ufrag, "ufrag value must not contain any whitespaces");
|
||||||
if (!Strings.isNullOrEmpty(pwd)) {
|
mediaAttributes.put("ice-ufrag", ufrag);
|
||||||
mediaAttributes.put("ice-pwd", pwd);
|
if (Strings.isNullOrEmpty(pwd)) {
|
||||||
|
throw new IllegalArgumentException("Transport element is missing required pwd attribute");
|
||||||
}
|
}
|
||||||
checkNoWhitespace(pwd, "pwd value must not contain any whitespaces");
|
checkNoWhitespace(pwd, "pwd value must not contain any whitespaces");
|
||||||
|
mediaAttributes.put("ice-pwd", pwd);
|
||||||
mediaAttributes.put("ice-options", HARDCODED_ICE_OPTIONS);
|
mediaAttributes.put("ice-options", HARDCODED_ICE_OPTIONS);
|
||||||
final IceUdpTransportInfo.Fingerprint fingerprint = transport.getFingerprint();
|
final IceUdpTransportInfo.Fingerprint fingerprint = transport.getFingerprint();
|
||||||
if (fingerprint != null) {
|
if (fingerprint != null) {
|
||||||
|
|
Loading…
Reference in a new issue