39 Commits

Author SHA1 Message Date
Ervin Hegedus
38850f912b
Merge pull request #3372 from notroj/v2-gcc-warning-fixes
Fix compiler warnings from GCC
2025-05-17 10:09:29 +02:00
Joe Orton
9d9a727349 Fix compiler warnings. Reported by GCC with flags:
-Wall -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS

Note, e.g. sprintf(digest, "%s%02x", digest, ...) is undefined behaviour because
the destination and source variables overlap, and GCC warnings for this.

acmp.c:258:13: warning: 'acmp_clone_node_no_state' defined but not used [-Wunused-function]
apache2_config.c:806:9: warning: unused variable 'offset' [-Wunused-variable]
apache2_config.c:1886:23: warning: unused variable 'dcfg' [-Wunused-variable]
apache2_config.c:1942:23: warning: unused variable 'dcfg' [-Wunused-variable]
apache2_config.c:2470:23: warning: unused variable 'dcfg' [-Wunused-variable]
apache2_config.c:2538:23: warning: unused variable 'dcfg' [-Wunused-variable]
apache2_util.c:226:11: warning: unused variable 'str' [-Wunused-variable]
apache2_util.c:225:11: warning: unused variable 'saved' [-Wunused-variable]
apache2_util.c:224:11: warning: unused variable 'parse_remote' [-Wunused-variable]
apache2_util.c:223:11: warning: unused variable 'remote' [-Wunused-variable]
msc_status_engine.c:216:17: warning: unused variable 'i' [-Wunused-variable]
msc_status_engine.c:375:55: warning: the address of 'pcre' will always evaluate as 'true' [-Waddress]
msc_crypt.c:67:17: warning: unused variable 'bytes' [-Wunused-variable]
msc_crypt.c:1083:33: warning: variable 'enc' set but not used [-Wunused-but-set-variable]
msc_crypt.c:1090:29: warning: variable 'enc' set but not used [-Wunused-but-set-variable]
/usr/include/bits/stdio2.h:30:10: warning: '__sprintf_chk' argument 5 overlaps destination object 'digest' [-Wrestrict]
msc_json.c:405:11: warning: unused variable 'json_data' [-Wunused-variable]
msc_crypt.c:1097:79: warning: '%s' directive argument is null [-Wformat-overflow=]
msc_logging.c:1144:20: warning: unused variable 'now' [-Wunused-variable]
msc_remote_rules.c:729:19: warning: unused variable 'word' [-Wunused-variable]
msc_remote_rules.c:727:17: warning: unused variable 'tmp' [-Wunused-variable]
msc_remote_rules.c:805:1: warning: control reaches end of non-void function [-Wreturn-type]
msc_tree.c:836:19: warning: unused variable 'ip' [-Wunused-variable]
msc_xml.c:29:44: warning: variable 'entity' set but not used [-Wunused-but-set-variable]
msc_util.c:2627:11: warning: unused variable 'start' [-Wunused-variable]
msc_util.c:2626:17: warning: unused variable 'fd' [-Wunused-variable]
msc_util.c:2624:18: warning: unused variable 'rc' [-Wunused-variable]
msc_util.c:1077:19: warning: array subscript 1 is outside array bounds of 'unsigned char[1]' [-Warray-bounds=]
2025-05-16 09:59:32 +01:00
Ervin Hegedus
d7b38f034e
Refactor code and build system to use libpcre2 as the default 2025-05-15 21:13:52 +02:00
Marc Stern
cd65a44d64 Removed useless code 2024-07-22 16:53:58 +02:00
Marc Stern
91da5872c1 Many null pointer checks 2024-02-20 13:15:52 +01:00
Martin Vierula
8fc0b519b7
Support for PCRE2 2022-11-08 08:06:39 -08:00
Victor Hora
b3fa87dc7c Fix NetBSD build by renaming the hmac function to avoid conflicts 2018-11-04 21:20:10 -05:00
Hideaki Hayashi
6473cf626d
Make url path absolute for SecHashEngine only when it is relative in the first place. Fix #752 2017-05-22 18:56:37 -03:00
Felipe Zimmerle
6f49bad748
Fix the hex digit size for SHA1 on msc_crypt implementation
Fix #1354
2017-05-22 18:48:20 -03:00
Felipe Zimmerle
a249574692
Avoids to flush xml buffer while assembling the injected html
Fix #742
2017-05-22 18:44:22 -03:00
Jeff Trawick
1ed95ad932 Fix invalid storage reference by apr_psprintf() when creating a string from salt[]. salt[] is not '\0'-terminated, so apr_psprintf() needs to be told the extent of the bytes to read.
It is easy to test old/new code standalone with valgrind;
jst insert the getkey() function into this template:

-----------getkey() goes here-----------------

int main(void)
{
    apr_pool_t *p;

    apr_initialize();
    apr_pool_create(&p, NULL);

    printf("%s\n", getkey(p));
    return 0;
}
2015-03-26 08:55:54 -07:00
Felipe Zimmerle
385a2828e8 Code cosmetics: Reduces the amounts of warning.
Removes the warnings by adding missing headers and removed unused variables.
2014-03-31 16:22:11 -07:00
Felipe Zimmerle
1e63e49db4 Uses %zu to print size_t instead of %d.
This will help to reduce the amount of warnings during the compilation
See #631 for further information.
2014-03-31 16:22:11 -07:00
Breno Silva
464ac1ecac Fix crash when use SessionID as paramenter in SecHashKey 2013-07-17 08:51:31 -07:00
Breno Silva
5cf5ff043a Fixed: flush libxml2 output buffer 2013-06-04 19:58:36 -07:00
Breno Silva
df0b048254 Setting crypt outpur buffer as libxml2 output size 2013-06-04 11:02:44 -07:00
Breno Silva
9517c3475d Fixed: URL normalization for SecHashEngine 2013-06-04 10:59:00 -07:00
Breno Silva
aa18ec7f45 Updated copyright dates 2013-04-19 03:20:46 -04:00
Greg Wroblewski
f14eaeb3d0 Fixed build on Apache 2.4. 2012-11-06 14:33:06 -08:00
Breno Silva
451041cd8c Change names of HMAC feature to HASH 2012-10-30 18:19:11 -04:00
Breno Silva
53d422e9de Change names of HMAC feature to HASH 2012-10-30 18:02:22 -04:00
brenosilva
a27e3a901d Removed prng() function and added apr_generate_random_bytes 2012-10-18 18:57:06 +00:00
brenosilva
8aa17b5469 Removed prng() function and added apr_generate_random_bytes 2012-10-18 18:53:10 +00:00
brenosilva
ee31c5ba9f Fix LibXml2.9.0 issue 2012-10-18 17:10:12 +00:00
brenosilva
a9266d4ca1 Updated getkey function 2012-10-18 17:02:09 +00:00
brenosilva
8d5131a186 Fixed some dereferenced pointers 2012-08-16 18:26:20 +00:00
brenosilva
c24eaec77a Fixed unused error_msg in msc_crypt 2012-08-16 12:32:08 +00:00
brenosilva
8cec8c7e6d Make internal m_strcasestr default 2012-08-15 16:08:02 +00:00
brenosilva
592ec392d1 Remove ctl:ruleUpdateTarget* and add ctl:ruleRemovetarget* 2012-08-02 18:04:53 +00:00
brenosilva
3bb931e188 Fix warnings 2012-06-17 13:32:07 +00:00
brenosilva
22e20c6997 Fix windows error compilation 2012-06-15 20:27:21 +00:00
brenosilva
4ab785c192 Fix PRNG code and windows compilation errors 2012-06-15 19:27:59 +00:00
brenosilva
575356f10c Fix PRNG code 2012-06-15 17:06:10 +00:00
brenosilva
4ef3cc8eba Improve random number generator 2012-06-15 16:56:50 +00:00
brenosilva
f72ba4d36f Improve random number generator 2012-06-15 13:15:51 +00:00
brenosilva
39fcad4566 Improve random number generator 2012-06-15 12:43:29 +00:00
brenosilva
563017fce6 Fix loop into getkey 2012-06-15 12:13:32 +00:00
brenosilva
f162409851 Added null pointer check 2012-06-06 12:22:44 +00:00
brenosilva
866cb6d6b4 Update trunk for 2.7 2012-05-10 23:18:39 +00:00