------------------------------------------------------------ revno: 11709 revision-id: squid3@treenet.co.nz-20121126083513-0ogjpbo3quuayyxd parent: squid3@treenet.co.nz-20121126083405-5pp94yl6atxp1tds committer: Amos Jeffries branch nick: 3.2 timestamp: Mon 2012-11-26 01:35:13 -0700 message: digest_edirectory_auth: improved error handling Malicious response from LDAP server can cause squid helper to crash. Missing realm value returned from LDAP without error/missing value being indicated in the response can lead to strcmp() using a NULL pointer. Extremely unlikely to happen in practice, but worth fixing. Detected by Coverity Scan. Issue 740399 ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20121126083513-0ogjpbo3quuayyxd # target_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # testament_sha1: c2398ffc474bef2247f57c5309b783cc851ae626 # timestamp: 2012-11-26 08:37:01 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/branches\ # /SQUID_3_2 # base_revision_id: squid3@treenet.co.nz-20121126083405-\ # 5pp94yl6atxp1tds # # Begin patch === modified file 'helpers/digest_auth/eDirectory/ldap_backend.cc' --- helpers/digest_auth/eDirectory/ldap_backend.cc 2012-07-28 05:38:50 +0000 +++ helpers/digest_auth/eDirectory/ldap_backend.cc 2012-11-26 08:35:13 +0000 @@ -286,7 +286,8 @@ value = values; while (*value) { if (encrpass) { - if (strcmp(strtok(*value, delimiter), realm) == 0) { + const char *t = strtok(*value, delimiter); + if (t && strcmp(t, realm) == 0) { password = strtok(NULL, delimiter); break; }