--------------------- PatchSet 10289 Date: 2007/12/20 10:43:11 Author: adri Branch: s27_adri Tag: (none) Log: Check for pointer being != NULL before calling strIs(Not)Null() Members: src/HttpHeader.c:1.28.6.1.4.22->1.28.6.1.4.23 src/authenticate.c:1.35.16.1->1.35.16.2 src/client_side.c:1.202.2.9.4.18->1.202.2.9.4.19 src/store.c:1.49.4.3.4.6->1.49.4.3.4.7 Index: squid/src/HttpHeader.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/HttpHeader.c,v retrieving revision 1.28.6.1.4.22 retrieving revision 1.28.6.1.4.23 diff -u -r1.28.6.1.4.22 -r1.28.6.1.4.23 --- squid/src/HttpHeader.c 20 Dec 2007 10:35:24 -0000 1.28.6.1.4.22 +++ squid/src/HttpHeader.c 20 Dec 2007 10:43:11 -0000 1.28.6.1.4.23 @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.c,v 1.28.6.1.4.22 2007/12/20 10:35:24 adri Exp $ + * $Id: HttpHeader.c,v 1.28.6.1.4.23 2007/12/20 10:43:11 adri Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -1172,7 +1172,7 @@ field = httpHeaderGetString(hdr, id); if (!field) /* no authorization field */ return NULL; - if (strIsNull(*field)) + if (field && strIsNull(*field)) return NULL; l = strlen(auth_scheme); Index: squid/src/authenticate.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/authenticate.c,v retrieving revision 1.35.16.1 retrieving revision 1.35.16.2 diff -u -r1.35.16.1 -r1.35.16.2 --- squid/src/authenticate.c 20 Dec 2007 10:35:24 -0000 1.35.16.1 +++ squid/src/authenticate.c 20 Dec 2007 10:43:11 -0000 1.35.16.2 @@ -1,6 +1,6 @@ /* - * $Id: authenticate.c,v 1.35.16.1 2007/12/20 10:35:24 adri Exp $ + * $Id: authenticate.c,v 1.35.16.2 2007/12/20 10:43:11 adri Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -478,7 +478,7 @@ * No check for function required in the if: its compulsory for conn based * auth modules */ - if (proxy_auth strIsNotNull(*proxyauth) && conn && conn->auth_user_request && + if (proxy_auth && strIsNotNull(*proxyauth) && conn && conn->auth_user_request && authenticateUserAuthenticated(conn->auth_user_request) && strCmp(*proxy_auth, authscheme_list[conn->auth_user_request->auth_user->auth_module - 1].authConnLastHeader(conn->auth_user_request))) { debug(29, 2) ("authenticateAuthenticate: DUPLICATE AUTH - authentication header on already authenticated connection!. AU %p, Current user '%s' proxy_auth %.*s\n", conn->auth_user_request, authenticateUserRequestUsername(conn->auth_user_request), strLen2(proxy_auth), strBuf2(proxy_auth)); Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.202.2.9.4.18 retrieving revision 1.202.2.9.4.19 diff -u -r1.202.2.9.4.18 -r1.202.2.9.4.19 --- squid/src/client_side.c 20 Dec 2007 03:22:36 -0000 1.202.2.9.4.18 +++ squid/src/client_side.c 20 Dec 2007 10:43:11 -0000 1.202.2.9.4.19 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.202.2.9.4.18 2007/12/20 03:22:36 adri Exp $ + * $Id: client_side.c,v 1.202.2.9.4.19 2007/12/20 10:43:11 adri Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -638,7 +638,7 @@ vary = request->vary_headers; } - if (strIsNotNull(*etag) && strIsNotNull(vary)) { + if (etag && strIsNotNull(*etag) && strIsNotNull(vary)) { storeAddVary(url, entry->mem_obj->method, NULL, etag, &request->vary_hdr, &request->vary_headers, &request->vary_encoding); } } @@ -768,7 +768,7 @@ http->out.offset = 0; if (can_revalidate) { etag = httpHeaderGetString(&http->old_entry->mem_obj->reply->header, HDR_ETAG); - if (strIsNotNull(*etag)) { + if (etag && strIsNotNull(*etag)) { http->request->etag = strCDup(*etag); http->request->flags.cache_validation = 1; } Index: squid/src/store.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/store.c,v retrieving revision 1.49.4.3.4.6 retrieving revision 1.49.4.3.4.7 diff -u -r1.49.4.3.4.6 -r1.49.4.3.4.7 --- squid/src/store.c 15 Dec 2007 06:08:25 -0000 1.49.4.3.4.6 +++ squid/src/store.c 20 Dec 2007 10:43:13 -0000 1.49.4.3.4.7 @@ -1,6 +1,6 @@ /* - * $Id: store.c,v 1.49.4.3.4.6 2007/12/15 06:08:25 adri Exp $ + * $Id: store.c,v 1.49.4.3.4.7 2007/12/20 10:43:13 adri Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -718,7 +718,7 @@ if (key) state->key = xstrdup(storeKeyText(key)); state->vary_headers = stringDup(vary_headers); - if (strIsNotNull(*accept_encoding)) + if (accept_encoding && strIsNotNull(*accept_encoding)) state->accept_encoding = stringDup(accept_encoding); if (etag && strIsNotNull(*etag)) state->etag = strCDupOffset(*etag, 0);