1398970: Use 'ap_strcasestr' instead of a strdup/str_tolower/strstr sequence
1407853: cppCheck: Suspicious condition.
1398480: cppcheck: arrayIndexThenCheck - change the order of the tests in
order to avoid a potential out-of-bound access.
1398478: ccpcheck: duplicateExpression - 'vary_by_language' is tested twice
1411862: Use apr_is_empty_table() instead of getting a table and checking the
value of the 'nelts' field.
1397320: remove extra ';'
Submitted by: jailletc36
Reviewed by: jailletc36, minfrin, sf
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1418945 13f79535-47bb-0310-9956-
ffa450edef68
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * (2/x) backport some easy patch to keep 2.4.x in line with trunk as much as possible
- 1398970: Use 'ap_strcasestr' instead of a strdup/str_tolower/strstr sequence
- 1407853: cppCheck: Suspicious condition.
- 1398480: cppcheck: arrayIndexThenCheck - change the order of the tests in
- order to avoid a potential out-of-bound access.
- 1398478: ccpcheck: duplicateExpression - 'vary_by_language' is tested twice
- 1411862: Use apr_is_empty_table() instead of getting a table and checking the
- value of the 'nelts' field.
- 1397320: remove extra ';'
- trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1398970
- http://svn.apache.org/viewvc?view=revision&revision=1407853
- http://svn.apache.org/viewvc?view=revision&revision=1398480
- http://svn.apache.org/viewvc?view=revision&revision=1398478
- http://svn.apache.org/viewvc?view=revision&revision=1411862
- http://svn.apache.org/viewvc?view=revision&revision=1397320
- 2.4.c patch: http://people.apache.org/~jailletc36/backport2.patch
- +1: jailletc36, minfrin, sf
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
/* OK, this is non-critical; we can just not-redirect */
}
else if ((rv = apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle,
- &res, query, 0, r->user, NULL) == 0)) {
+ &res, query, 0, r->user, NULL)) == 0) {
for (rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1);
rv != -1;
rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1)) {
return AUTHZ_DENIED;
}
- if (apr_table_elts(grpstatus)->nelts == 0) {
+ if (apr_is_empty_table(grpstatus)) {
/* no groups available, so exit immediately */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01666)
"Authorization of user %s to access %s failed, reason: "
return AUTHZ_DENIED;
}
- if (apr_table_elts(grpstatus)->nelts == 0) {
+ if (apr_is_empty_table(grpstatus)) {
/* no groups available, so exit immediately */
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01670)
"Authorization of user %s to access %s failed, reason: "
err = (*repos_hooks->walk)(&ctx.w, DAV_INFINITY, &multi_status);
if (err == NULL) {
- *response = multi_status;;
+ *response = multi_status;
}
/* else: implies a 5xx status code occurred. */
}
const char *str = apr_table_get(r->headers_out,
"Cache-Control");
if (str) {
- char *str1 = apr_pstrdup(r->pool, str);
- ap_str_tolower(str1);
- if (strstr(str1, "no-transform")) {
+ if (ap_strcasestr(str, "no-transform")) {
/* can't use this provider; try next */
continue;
}
apr_status_t ret;
#ifndef NO_PROTOCOL
const char *cachecontrol;
- char *str;
#endif
harness_ctx *ctx = f->ctx;
ap_filter_rec_t *filter = f->frec;
cachecontrol = apr_table_get(f->r->headers_out,
"Cache-Control");
if (cachecontrol) {
- str = apr_pstrdup(f->r->pool, cachecontrol);
- ap_str_tolower(str);
- if (strstr(str, "no-transform")) {
+ if (ap_strcasestr(cachecontrol, "no-transform")) {
ap_remove_output_filter(f);
return ap_pass_brigade(f->next, bb);
}
int i, numverts, crossings = 0;
double x = point[X], y = point[Y];
- for (numverts = 0; pgon[numverts][X] != -1 && numverts < MAXVERTS;
+ for (numverts = 0; numverts < MAXVERTS && pgon[numverts][X] != -1;
numverts++) {
/* just counting the vertexes */
}
}
if (neg->is_transparent || vary_by_type || vary_by_language ||
- vary_by_language || vary_by_charset || vary_by_encoding) {
+ vary_by_charset || vary_by_encoding) {
apr_table_mergen(hdrs, "Vary", 2 + apr_pstrcat(r->pool,
neg->is_transparent ? ", negotiate" : "",