Note that the function will be available in APR.
Silent a smatch warning:
mod_auth_form.c:626 get_form_auth() warn: variable dereferenced before check 'sent_user' (see line 616)
Use 'memcpy' instead of 'strcpy' when the size of the string has already been computed.
Fix compilation failure :
unixd.c: In function ‘ap_unixd_mpm_set_signals’:
unixd.c:579:5: error: implicit declaration of function ‘apr_signal’; did you mean ‘strsignal’? [-Werror=implicit-function-declaration]
apr_signal(SIGPIPE, SIG_IGN);
^~~~~~~~~~
strsignal
Not sure where it comes from, maybe related to r1812301.
mod_substitute: add runtime traces. PR 61132.
In verify_ocsp_status in ssl_engine_ocsp.c, the log message, "OCSP response not successful: %d" should print the value of r instead of rc.
The value of rc will always be 0.
PR 61876 [sam <sam.eastman.4114 gmail.com>]
Success of 'SHGetMalloc()' should be tested with the SUCCEEDED macro.
/!\ This commit is _NOT COMPILE TESTED_. (I don't have a windows build environment available)
See PR 60086.
Axe some dead code.
See PR 60086.
Fix typo
Fix a potential un-intialized variable usage warning.
This can not be a runtime ixsue, because, in such a case, we would assert and abort before.
PR 59819.
Submitted by: minfrin, jailletc36, jailletc36, jailletc36, ylavic, jailletc36, jailletc36, jailletc36, jailletc36, jailletc36
Reviewed by: jailletc36, ylavic, covener
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@
1832607 13f79535-47bb-0310-9956-
ffa450edef68
jailletc36: There should be a compatibility note for the new directives.
(done in r1828478)
- *) Easy patches: synch 2.4.x and trunk
- - core: add a comment
- - mod_auth_form: Silence a static checker warning
- - unixd: fix a compilation warning
- - mod_sed: do not compute string length twice
- - mod_substitute: add some TRACE8 debugging messages
- - mod_ssl: fix the error code written in a log message
- - win32/Apachemonitor: Success of 'SHGetMalloc()' should be tested with the SUCCEEDED macro.
- - core: Axe some dead code
- - core: Fix typo in comment
- - core: Fix a potential un-intialized variable usage warning.
- trunk patch: http://svn.apache.org/r1490294
- http://svn.apache.org/r1734635
- http://svn.apache.org/r1749403
- http://svn.apache.org/r1813116
- http://svn.apache.org/r1816179
- http://svn.apache.org/r1817598
- http://svn.apache.org/r1832198
- http://svn.apache.org/r1832200
- http://svn.apache.org/r1832277
- http://svn.apache.org/r1832317
- 2.4.x patch: svn merge -c 1490294,1734635,1749403,1813116,1816179,1817598,1832198,1832200,1832277,1832317 ^/httpd/httpd/trunk .
- +1: jailletc36, ylavic, covener
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
const char *s);
/**
- * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2,
+ * Perform a case-insensitive comparison of two strings @a str1 and @a str2,
* treating upper and lower case values of the 26 standard C/POSIX alphabetic
* characters as equivalent. Extended latin characters outside of this set
* are treated as unique octets, irrespective of the current locale.
AP_DECLARE(int) ap_cstr_casecmp(const char *s1, const char *s2);
/**
- * Perform a case-insensitive comparison of two strings @a atr1 and @a atr2,
+ * Perform a case-insensitive comparison of two strings @a str1 and @a str2,
* treating upper and lower case values of the 26 standard C/POSIX alphabetic
* characters as equivalent. Extended latin characters outside of this set
* are treated as unique octets, irrespective of the current locale.
/* have we isolated the user and pw before? */
get_notes_auth(r, sent_user, sent_pw, sent_method, sent_mimetype);
- if (*sent_user && *sent_pw) {
+ if (sent_user && *sent_user && sent_pw && *sent_pw) {
return OK;
}
/* The following is a shrinking transformation, therefore safe. */
+/* Note: this function is deprecated in favour of apr_unescape_entity() in APR */
static void decodehtml(char *s)
{
int val, i, j;
apr_size_t replen;
apr_size_t patlen;
int flatten;
+ const char *from;
} subst_pattern_t;
typedef struct {
apr_bucket_delete(tmp_b); \
} while (0)
+#define CAP2LINEMAX(n) ((n) < (apr_size_t)200 ? (int)(n) : 200)
+
static apr_status_t do_pattmatch(ap_filter_t *f, apr_bucket *inb,
apr_bucket_brigade *mybb,
apr_pool_t *pool)
if (apr_bucket_read(b, &buff, &bytes, APR_BLOCK_READ)
== APR_SUCCESS) {
int have_match = 0;
+
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "Line read (%" APR_SIZE_T_FMT " bytes): %.*s",
+ bytes, CAP2LINEMAX(bytes), buff);
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "Replacing %s:'%s' by '%s'",
+ script->pattern ? "string" :
+ script->regexp ? "regex" :
+ "unknown",
+ script->from, script->replacement);
+
vb.strlen = 0;
if (script->pattern) {
const char *repl;
apr_size_t repl_len = strlen(script->replacement);
while ((repl = apr_strmatch(script->pattern, buff, bytes)))
{
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "Matching found, result: '%s'",
+ script->replacement);
have_match = 1;
/* get offset into buff for pattern */
len = (apr_size_t) (repl - buff);
*/
char *copy = ap_varbuf_pdup(pool, &vb, NULL, 0,
buff, bytes, &len);
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "New line (%" APR_SIZE_T_FMT " bytes): %.*s",
+ len, CAP2LINEMAX(len), copy);
tmp_b = apr_bucket_pool_create(copy, len, pool,
f->r->connection->bucket_alloc);
APR_BUCKET_INSERT_BEFORE(b, tmp_b);
*/
if (space_left < b->length)
return APR_ENOMEM;
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "New line (%" APR_SIZE_T_FMT " bytes): %.*s",
+ bytes, CAP2LINEMAX(bytes), buff);
}
}
}
while (!ap_regexec_len(script->regexp, pos, left,
AP_MAX_REG_MATCH, regm, 0)) {
apr_status_t rv;
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "Matching found");
have_match = 1;
if (script->flatten && !force_quick) {
/* check remaining buffer size */
cfg->max_line_length - vb.strlen);
if (rv != APR_SUCCESS)
return rv;
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "Result: '%s'", vb.buf);
}
else {
apr_size_t repl_len;
tmp_b = apr_bucket_transient_create(repl, repl_len,
f->r->connection->bucket_alloc);
APR_BUCKET_INSERT_BEFORE(b, tmp_b);
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "Result: '%s'", repl);
}
/*
* reset to past what we just did. pos now maps to b
*/
copy = ap_varbuf_pdup(pool, &vb, NULL, 0, pos, left,
&len);
+ ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, f->r,
+ "New line (%" APR_SIZE_T_FMT " bytes): %.*s",
+ len, CAP2LINEMAX(len), copy);
tmp_b = apr_bucket_pool_create(copy, len, pool,
f->r->connection->bucket_alloc);
APR_BUCKET_INSERT_BEFORE(b, tmp_b);
nscript->regexp = NULL;
nscript->replacement = NULL;
nscript->patlen = 0;
+ nscript->from = from;
if (is_pattern) {
nscript->patlen = strlen(from);
if (eval->hsize <= reqsize) {
grow_hold_buffer(eval, reqsize);
}
- strcpy(eval->hspend, sz);
+ memcpy(eval->hspend, sz, len + 1);
/* hspend will now point to NULL character */
eval->hspend += len;
}
if (eval->gsize < reqsize) {
grow_gen_buffer(eval, reqsize, gspend);
}
- strcpy(*gspend, sz);
+ memcpy(*gspend, sz, len + 1);
/* *gspend will now point to NULL character */
*gspend += len;
}
if (r != OCSP_RESPONSE_STATUS_SUCCESSFUL) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, s, APLOGNO(01922)
- "OCSP response not successful: %d", rc);
+ "OCSP response not successful: %d", r);
rc = V_OCSP_CERTSTATUS_UNKNOWN;
}
}
#include "os.h"
#include "ap_mpm.h"
#include "apr_thread_proc.h"
+#include "apr_signal.h"
#include "apr_strings.h"
#include "apr_portable.h"
#ifdef HAVE_PWD_H
** we force everything to be APR_PROGRAM, and never
** APR_SHELLCMD
*/
- if(apr_procattr_cmdtype_set(attr, APR_PROGRAM) != APR_SUCCESS) {
+ if (apr_procattr_cmdtype_set(attr, APR_PROGRAM) != APR_SUCCESS) {
return APR_EGENERAL;
}
/* If matching internal to path, and we happen to match something
* other than a directory, skip it
*/
- if (rest && (rv == APR_SUCCESS) && (dirent.filetype != APR_DIR)) {
+ if (rest && (dirent.filetype != APR_DIR)) {
continue;
}
fnew = (fnames *) apr_array_push(candidates);
case AP_EXPR_FUNC_STRING:
case AP_EXPR_FUNC_OP_UNARY:
case AP_EXPR_FUNC_OP_BINARY: {
- const struct expr_provider_single *prov;
+ const struct expr_provider_single *prov = NULL;
switch (parms->type) {
case AP_EXPR_FUNC_STRING:
prov = string_func_providers;
default:
ap_assert(0);
}
- while (prov->func) {
+ while (prov && prov->func) {
int match;
if (parms->type == AP_EXPR_FUNC_OP_UNARY)
match = !strcmp(prov->name, parms->name);
WM_SETTEXT,
(WPARAM) NULL, (LPARAM) szCmp);
}
- if (SHGetMalloc(&pMalloc)) {
+ if (SUCCEEDED(SHGetMalloc(&pMalloc))) {
pMalloc->lpVtbl->Free(pMalloc, il);
pMalloc->lpVtbl->Release(pMalloc);
}