[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 180/254: test557: fix ubsan runtime error due to in
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 180/254: test557: fix ubsan runtime error due to int left shift |
Date: |
Sat, 17 Jun 2017 16:53:32 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit 35682764a9dc7eb0fed3fbb1c0074f1c34dd60b2
Author: Jay Satiro <address@hidden>
AuthorDate: Mon May 29 18:04:53 2017 -0400
test557: fix ubsan runtime error due to int left shift
- Test curl_msnprintf negative int width arg using INT_MIN instead of
1 << 31 which is undefined behavior.
Closes https://github.com/curl/curl/issues/1516
---
tests/libtest/lib557.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/libtest/lib557.c b/tests/libtest/lib557.c
index ca3118aec..4a598f22d 100644
--- a/tests/libtest/lib557.c
+++ b/tests/libtest/lib557.c
@@ -27,6 +27,10 @@
#include "test.h"
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#ifdef HAVE_LOCALE_H
# include <locale.h> /* for setlocale() */
#endif
@@ -1621,8 +1625,8 @@ static int test_float_formatting(void)
123456789123456789123456789.2987654);
errors += strlen_check(buf, 325);
- /* 1<<31 turns negative (-2147483648) when used signed */
- curl_msnprintf(buf, sizeof(buf), "%*f", (1<<31), 9.1);
+ /* check negative when used signed */
+ curl_msnprintf(buf, sizeof(buf), "%*f", INT_MIN, 9.1);
errors += string_check(buf, "9.100000");
/* curl_msnprintf() limits a single float output to 325 bytes maximum
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 193/254: CURLOPT_FNMATCH_FUNCTION.3: also modified example to avoid fcpp issues, (continued)
- [GNUnet-SVN] [gnurl] 193/254: CURLOPT_FNMATCH_FUNCTION.3: also modified example to avoid fcpp issues, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 222/254: curl_ntlm_core: pass unsigned char to toupper, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 163/254: cmake: fix build on Ubuntu 14.04, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 185/254: build-wolfssl: Sync config with wolfSSL 3.11, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 208/254: test1538: fix typo, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 111/254: curl.1: depend the build on the Makefile.inc too, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 198/254: curl-compilers.m4: fix compiler_num for clang, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 100/254: curl: remove tool_writeenv.[ch], gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 129/254: mbedtls: Support server renegotiation request, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 157/254: cmake: auto detection of CURL_CA_BUNDLE/CURL_CA_PATH, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 180/254: test557: fix ubsan runtime error due to int left shift,
gnunet <=
- [GNUnet-SVN] [gnurl] 213/254: cyassl: define build macros before including ssl.h, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 46/254: examples: fixed too long line and too long string warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 203/254: build: provide easy code coverage measuring, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 248/254: configure: update the copyright year in the output, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 139/254: CURLOPT_HTTPPROXYTUNNEL: clarify, add example, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 67/254: buffer: use data->set.buffer_size instead of BUFSIZE, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 195/254: CURLOPT_SSH_KEY*.3: typos, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 192/254: CURLOPT_FNMATCH_DATA.3: modified example to avoid fcpp issues, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 140/254: docs/libcurl/opts: added more examples in man pages, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 171/254: ssh: fix 'left' may be used uninitialized, gnunet, 2017/06/17