diff -Nru sflphone-1.4.1/debian/changelog sflphone-1.4.1/debian/changelog --- sflphone-1.4.1/debian/changelog 2015-08-13 06:44:00.000000000 +0200 +++ sflphone-1.4.1/debian/changelog 2015-10-05 11:56:13.000000000 +0200 @@ -1,3 +1,19 @@ +sflphone (1.4.1-0.2ubuntu2) UNRELEASED; urgency=medium + + * d/patches/fixed_upstream-gcc5-auth-fix.patch: fix SIP authentication (LP: + #1497871). + . + With gcc 5.x, valgrind indicates that the SIP password is pointing at + a value on the stack in a different function. The use of the temporary + std::string on the stack causes the cred_[i].data assignment to point to + a stack address, that isn't be valid by the time the password is needed + to do auth. This fixes the password pointer to be like the other auth + strings set in this function, and fixes SIP auth. + . + Not forwarded upstream: already refactored in upstream ring code. + + -- Ryan Murray Mon, 05 Oct 2015 11:54:25 +0200 + sflphone (1.4.1-0.2ubuntu1) wily; urgency=medium * Merge with Debian unstable. Remaining Ubuntu changes: diff -Nru sflphone-1.4.1/debian/patches/fixed_upstream-gcc5-auth-fix.patch sflphone-1.4.1/debian/patches/fixed_upstream-gcc5-auth-fix.patch --- sflphone-1.4.1/debian/patches/fixed_upstream-gcc5-auth-fix.patch 1970-01-01 01:00:00.000000000 +0100 +++ sflphone-1.4.1/debian/patches/fixed_upstream-gcc5-auth-fix.patch 2015-10-05 11:52:28.000000000 +0200 @@ -0,0 +1,36 @@ +Author: Ryan Murray +Last-Update: 2014-10-18 +Forwarded: not-needed, already refactored in upstream ring code +Description: fix SIP authentication + +With gcc 5.x, valgrind indicates that the SIP password is pointing at +a value on the stack in a different function. The use of the temporary +std::string on the stack causes the cred_[i].data assignment to point to +a stack address, that isn't be valid by the time the password is needed +to do auth. This fixes the password pointer to be like the other auth +strings set in this function, and fixes SIP auth. + +--- a/daemon/src/sip/sipaccount.cpp ++++ b/daemon/src/sip/sipaccount.cpp +@@ -1453,18 +1453,17 @@ + + for (const auto &item : credentials_) { + map::const_iterator val = item.find(CONFIG_ACCOUNT_PASSWORD); +- const std::string password = val != item.end() ? val->second : ""; +- int dataType = (md5HashingEnabled and password.length() == 32) ++ int dataType = (md5HashingEnabled and val->second.length() == 32) + ? PJSIP_CRED_DATA_DIGEST + : PJSIP_CRED_DATA_PLAIN_PASSWD; + ++ cred_[i].data = pj_str((char*) (val != item.end() ? val->second.c_str() : "")); ++ + val = item.find(CONFIG_ACCOUNT_USERNAME); + + if (val != item.end()) + cred_[i].username = pj_str((char*) val->second.c_str()); + +- cred_[i].data = pj_str((char*) password.c_str()); +- + val = item.find(CONFIG_ACCOUNT_REALM); + + if (val != item.end()) diff -Nru sflphone-1.4.1/debian/patches/series sflphone-1.4.1/debian/patches/series --- sflphone-1.4.1/debian/patches/series 2015-07-23 20:22:19.000000000 +0200 +++ sflphone-1.4.1/debian/patches/series 2015-10-05 11:54:18.000000000 +0200 @@ -3,3 +3,4 @@ pj_project_status.patch remove-nonexistant-kde-include-dir.patch gcc-5.patch +fixed_upstream-gcc5-auth-fix.patch