
Untitled
By: a guest on
Jul 29th, 2012 | syntax:
None | size: 0.95 KB | hits: 8 | expires: Never
//[snip]
const QString& strParamsPart = rex1.capturedTexts()[6];
//[snip]
QList<SipUriParam> params = SipUriParam::parseAll(strParamsPart, &_ok);
if (!_ok) {
if (ok) *ok = false;
return SipUri();
}
//[snip]
QList<SipUriParam> SipUriParam::parseAll(const QString& s, bool *ok) {
QList<SipUriParam> result;
QRegExp rex1("((?:[^=;]+)(?:=[^;&]*))"); // after calling this, s becomes invalid
int pos = 0;
bool _ok = true;
while(rex1.indexIn(s, pos) != -1) { // here the code SIGSEGVs
SipUriParam p = SipUriParam::parse(rex1.capturedTexts()[0], &_ok);
if (!_ok) {
if (ok) *ok = false;
result.clear();
return result;
} else {
result.append(p);
}
}
if (ok) *ok = true;
return result;
}