mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-25 20:28:27 +00:00
Fixes for -pedantic build mode
PUBLISHED_FROM=d0a15356cf047e579c74869ce3e8fe813752e8c7
This commit is contained in:
1 parent
95fcb261eb
commit
4680573a6b
3 files changed
+16
-10
No files matched your search
+8
-5
@@ -4537,9 +4537,10 @@ enum mg_ssl_if_result mg_ssl_if_conn_init(
|
|||||||
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv2);
|
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv2);
|
||||||
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv3);
|
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv3);
|
||||||
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_TLSv1);
|
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_TLSv1);
|
||||||
SSL_CTX_set_session_id_context(ctx->ssl_ctx,
|
SSL_CTX_set_session_id_context(
|
||||||
(void *) mg_default_session_id_context,
|
ctx->ssl_ctx,
|
||||||
strlen(mg_default_session_id_context));
|
(const unsigned char *) mg_default_session_id_context,
|
||||||
|
strlen(mg_default_session_id_context));
|
||||||
#ifdef MG_SSL_OPENSSL_NO_COMPRESSION
|
#ifdef MG_SSL_OPENSSL_NO_COMPRESSION
|
||||||
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_COMPRESSION);
|
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_COMPRESSION);
|
||||||
#endif
|
#endif
|
||||||
@@ -9376,13 +9377,15 @@ static void mg_do_ssi_include(struct mg_connection *nc, struct http_message *hm,
|
|||||||
*/
|
*/
|
||||||
if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) {
|
if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) {
|
||||||
/* File name is relative to the webserver root */
|
/* File name is relative to the webserver root */
|
||||||
snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
|
if (snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name) < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
|
} else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
|
||||||
/*
|
/*
|
||||||
* File name is relative to the webserver working directory
|
* File name is relative to the webserver working directory
|
||||||
* or it is absolute system path
|
* or it is absolute system path
|
||||||
*/
|
*/
|
||||||
snprintf(path, sizeof(path), "%s", file_name);
|
if (snprintf(path, sizeof(path), "%s", file_name) < 0) return;
|
||||||
} else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
|
} else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
|
||||||
sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
|
sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
|
||||||
/* File name is relative to the currect document */
|
/* File name is relative to the currect document */
|
||||||
|
|||||||
+4
-2
@@ -29,13 +29,15 @@ static void mg_do_ssi_include(struct mg_connection *nc, struct http_message *hm,
|
|||||||
*/
|
*/
|
||||||
if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) {
|
if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) {
|
||||||
/* File name is relative to the webserver root */
|
/* File name is relative to the webserver root */
|
||||||
snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name);
|
if (snprintf(path, sizeof(path), "%s/%s", opts->document_root, file_name) < 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
} else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
|
} else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) {
|
||||||
/*
|
/*
|
||||||
* File name is relative to the webserver working directory
|
* File name is relative to the webserver working directory
|
||||||
* or it is absolute system path
|
* or it is absolute system path
|
||||||
*/
|
*/
|
||||||
snprintf(path, sizeof(path), "%s", file_name);
|
if (snprintf(path, sizeof(path), "%s", file_name) < 0) return;
|
||||||
} else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
|
} else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 ||
|
||||||
sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
|
sscanf(tag, " \"%[^\"]\"", file_name) == 1) {
|
||||||
/* File name is relative to the currect document */
|
/* File name is relative to the currect document */
|
||||||
|
|||||||
@@ -78,9 +78,10 @@ enum mg_ssl_if_result mg_ssl_if_conn_init(
|
|||||||
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv2);
|
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv2);
|
||||||
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv3);
|
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_SSLv3);
|
||||||
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_TLSv1);
|
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_TLSv1);
|
||||||
SSL_CTX_set_session_id_context(ctx->ssl_ctx,
|
SSL_CTX_set_session_id_context(
|
||||||
(void *) mg_default_session_id_context,
|
ctx->ssl_ctx,
|
||||||
strlen(mg_default_session_id_context));
|
(const unsigned char *) mg_default_session_id_context,
|
||||||
|
strlen(mg_default_session_id_context));
|
||||||
#ifdef MG_SSL_OPENSSL_NO_COMPRESSION
|
#ifdef MG_SSL_OPENSSL_NO_COMPRESSION
|
||||||
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_COMPRESSION);
|
SSL_CTX_set_options(ctx->ssl_ctx, SSL_OP_NO_COMPRESSION);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in new issue
Block a user