]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
strerror: don't bit shift a signed integer
authorJay Satiro <raysatiro@yahoo.com>
Fri, 1 Apr 2016 01:05:29 +0000 (21:05 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Fri, 1 Apr 2016 01:05:29 +0000 (21:05 -0400)
Bug: https://github.com/curl/curl/issues/744
Reported-by: Alexis La Goutte
lib/strerror.c

index d222a1fc0a030452c7dc258e086cfaeea5407d73..cf1a04781684d19abf5cb9fc974262d3b07f56a5 100644 (file)
@@ -1076,14 +1076,13 @@ const char *Curl_sspi_strerror (struct connectdata *conn, int err)
     strncpy(outbuf, txt, outmax);
   else if(err == SEC_E_ILLEGAL_MESSAGE)
     snprintf(outbuf, outmax,
-             "SEC_E_ILLEGAL_MESSAGE (0x%04X%04X) - This error usually occurs "
+             "SEC_E_ILLEGAL_MESSAGE (0x%08X) - This error usually occurs "
              "when a fatal SSL/TLS alert is received (e.g. handshake failed). "
              "More detail may be available in the Windows System event log.",
-             (err >> 16) & 0xffff, err & 0xffff);
+             err);
   else {
     str = txtbuf;
-    snprintf(txtbuf, sizeof(txtbuf), "%s (0x%04X%04X)",
-             txt, (err >> 16) & 0xffff, err & 0xffff);
+    snprintf(txtbuf, sizeof(txtbuf), "%s (0x%08X)", txt, err);
     txtbuf[sizeof(txtbuf)-1] = '\0';
 
 #ifdef _WIN32_WCE