diff options
Diffstat (limited to 'meta-oe/recipes-support/cpprest/cpprest-2.10.2/787.patch')
-rw-r--r-- | meta-oe/recipes-support/cpprest/cpprest-2.10.2/787.patch | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/meta-oe/recipes-support/cpprest/cpprest-2.10.2/787.patch b/meta-oe/recipes-support/cpprest/cpprest-2.10.2/787.patch deleted file mode 100644 index 359a3ba526..0000000000 --- a/meta-oe/recipes-support/cpprest/cpprest-2.10.2/787.patch +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | From 212536f9d66400bef4400c55efd05dd01303c035 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andreas Stieger <astieger@suse.com> | ||
3 | Date: Sun, 17 Jun 2018 13:00:05 +0200 | ||
4 | Subject: [PATCH] Fix gcc8 error/warning -Werror=format-truncation= | ||
5 | |||
6 | utilities::datetime::to_string(): datetime_str and buf were oversized | ||
7 | for fitting into output without possible trunctation | ||
8 | --- | ||
9 | Release/src/utilities/asyncrt_utils.cpp | 7 ++++--- | ||
10 | 1 file changed, 4 insertions(+), 3 deletions(-) | ||
11 | |||
12 | diff --git a/Release/src/utilities/asyncrt_utils.cpp b/Release/src/utilities/asyncrt_utils.cpp | ||
13 | index 0e62bdee..be38907c 100644 | ||
14 | --- a/Release/src/utilities/asyncrt_utils.cpp | ||
15 | +++ b/Release/src/utilities/asyncrt_utils.cpp | ||
16 | @@ -691,12 +691,13 @@ utility::string_t datetime::to_string(date_format format) const | ||
17 | { | ||
18 | // Append fractional second, which is a 7-digit value with no trailing zeros | ||
19 | // This way, '1200' becomes '00012' | ||
20 | - char buf[9] = { 0 }; | ||
21 | + const int max_frac_length = 8; | ||
22 | + char buf[max_frac_length+1] = { 0 }; | ||
23 | snprintf(buf, sizeof(buf), ".%07ld", (long int)frac_sec); | ||
24 | // trim trailing zeros | ||
25 | - for (int i = 7; buf[i] == '0'; i--) buf[i] = '\0'; | ||
26 | + for (int i = max_frac_length-1; buf[i] == '0'; i--) buf[i] = '\0'; | ||
27 | // format the datetime into a separate buffer | ||
28 | - char datetime_str[max_dt_length+1] = {0}; | ||
29 | + char datetime_str[max_dt_length-max_frac_length-1+1] = {0}; | ||
30 | strftime(datetime_str, sizeof(datetime_str), "%Y-%m-%dT%H:%M:%S", &datetime); | ||
31 | // now print this buffer into the output buffer | ||
32 | snprintf(output, sizeof(output), "%s%sZ", datetime_str, buf); | ||