Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 29th, 2012  |  syntax: None  |  size: 0.95 KB  |  hits: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //[snip]
  2. const QString& strParamsPart = rex1.capturedTexts()[6];
  3. //[snip]
  4. QList<SipUriParam> params = SipUriParam::parseAll(strParamsPart, &_ok);
  5. if (!_ok) {
  6.     if (ok) *ok = false;
  7.         return SipUri();
  8.     }
  9. //[snip]
  10.  
  11. QList<SipUriParam> SipUriParam::parseAll(const QString& s, bool *ok) {
  12.             QList<SipUriParam> result;
  13.             QRegExp rex1("((?:[^=;]+)(?:=[^;&]*))"); // after calling this, s becomes invalid
  14.             int pos = 0;
  15.             bool _ok = true;
  16.             while(rex1.indexIn(s, pos) != -1) { // here the code SIGSEGVs
  17.                 SipUriParam p = SipUriParam::parse(rex1.capturedTexts()[0], &_ok);
  18.                 if (!_ok) {
  19.                     if (ok) *ok = false;
  20.                     result.clear();
  21.                     return result;
  22.                 } else {
  23.                     result.append(p);
  24.                 }
  25.             }
  26.  
  27.             if (ok) *ok = true;
  28.             return result;
  29.         }