packages/net/haproxy/patches/0005-BUG-MINOR-http-sample-gmtime-localtime-can-fail.patch
heil 8ce9ad4b8d haproxy: fixes from upstream
- [PATCH 05/13] BUG/MINOR: http/sample: gmtime/localtime can fail
 - [PATCH 06/13] DOC: typo in 'redirect', 302 code meaning
 - [PATCH 07/13] DOC: mention that %ms is left-padded with zeroes.
 - [PATCH 08/13] CLEANUP: .gitignore: ignore more test files
 - [PATCH 09/13] CLEANUP: .gitignore: finally ignore everything but what
 - [PATCH 10/13] MEDIUM: config: emit a warning on a frontend without
 - [PATCH 11/13] BUG/MEDIUM: counters: ensure that src_{inc,clr}_gpc0
 - [PATCH 12/13] DOC: ssl: missing LF
 - [PATCH 13/13] DOC: fix example of http-request using

Signed-off-by: heil <heil@terminal-consulting.de>
2015-09-07 00:00:45 +02:00

33 lines
1.1 KiB
Diff

From 955587271031d66e9b7a768e3bb18dae00b60cc6 Mon Sep 17 00:00:00 2001
From: Thierry FOURNIER <tfournier@arpalert.org>
Date: Wed, 8 Jul 2015 00:15:20 +0200
Subject: [PATCH 05/13] BUG/MINOR: http/sample: gmtime/localtime can fail
The man said that gmtime() and localtime() can return a NULL value.
This is not tested. It appears that all the values of a 32 bit integer
are valid, but it is better to check the return of these functions.
However, if the integer move from 32 bits to 64 bits, some 64 values
can be unsupported.
(cherry picked from commit fac9ccfb705702f211f99e67d5f5d5129002086a)
[wt: we only have sample_conv_date() in 1.5]
---
src/proto_http.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/proto_http.c b/src/proto_http.c
index 5db64b5..02dc42b 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -11249,6 +11249,8 @@ static int sample_conv_http_date(const struct arg *args, struct sample *smp)
curr_date += args[0].data.sint;
tm = gmtime(&curr_date);
+ if (!tm)
+ return 0;
temp = get_trash_chunk();
temp->len = snprintf(temp->str, temp->size - temp->len,
--
2.4.6