Index: azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/buffer.c
===================================================================
--- azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/buffer.c	(revision 457)
+++ azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/buffer.c	(revision 464)
@@ -541,8 +541,13 @@
         {
             //put b2 ahead of b1: [b2][b1], return b1
-            if (b2->size ==0)
+            if (b2->size == 0)
             {
                 // do nothing
                 result = 0;
+            }
+            else if (b1->size + b2->size < b2->size)
+            {
+                LogError("Failure: size_t overflow.");
+                result = MU_FAILURE;
             }
             else
Index: azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/crt_abstractions.c
===================================================================
--- azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/crt_abstractions.c	(revision 457)
+++ azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/crt_abstractions.c	(revision 464)
@@ -6,4 +6,5 @@
 #include <stdlib.h>
 #include <stdarg.h>
+#include <stdint.h>
 #include <string.h>
 #include <limits.h>
@@ -598,5 +599,5 @@
         case FST_NUMBER:
             val = fraction * pow(10.0, (double)exponential) * (double)signal;
-            if ((val >= (FLT_MAX * (-1.0f))) && (val <= FLT_MAX))
+            if ((val >= ((double)FLT_MAX * (-1.0))) && (val <= (double)FLT_MAX))
             {
                 /*Codes_SRS_CRT_ABSTRACTIONS_21_016: [The strtof_s must return the float that represents the value in the initial part of the string. If any.]*/
@@ -836,2 +837,48 @@
     return result;
 }
+
+/*takes "value" and transforms it into a decimal string*/
+/*10 => "10"*/
+/*return 0 when everything went ok*/
+int uint64_tToString(char* destination, size_t destinationSize, uint64_t value)
+{
+    int result;
+    size_t pos;
+    /*the below loop gets the number in reverse order*/
+    if (
+        (destination == NULL) ||
+        (destinationSize < 2) /*because the smallest number is '0\0' which requires 2 characters*/
+        )
+    {
+        result = MU_FAILURE;
+    }
+    else
+    {
+        pos = 0;
+        do
+        {
+            destination[pos++] = '0' + (value % 10);
+            value /= 10;
+        } while ((value > 0) && (pos < (destinationSize - 1)));
+
+        if (value == 0)
+        {
+            size_t w;
+            destination[pos] = '\0';
+            /*all converted and they fit*/
+            for (w = 0; w <= (pos - 1) >> 1; w++)
+            {
+                char temp;
+                temp = destination[w];
+                destination[w] = destination[pos - 1 - w];
+                destination[pos - 1 - w] = temp;
+            }
+            result = 0;
+        }
+        else
+        {
+            result = MU_FAILURE;
+        }
+    }
+    return result;
+}
Index: azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/httpapiexsas.c
===================================================================
--- azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/httpapiexsas.c	(revision 457)
+++ azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/httpapiexsas.c	(revision 464)
@@ -107,7 +107,7 @@
 {
     /*Codes_SRS_HTTPAPIEXSAS_06_005: [If the parameter handle is NULL then HTTAPIEX_SAS_Destroy shall do nothing and return.]*/
-    if (handle)
+    HTTPAPIEX_SAS_STATE* state = (HTTPAPIEX_SAS_STATE*)handle;
+    if (state)
     {
-        HTTPAPIEX_SAS_STATE* state = (HTTPAPIEX_SAS_STATE*)handle;
         /*Codes_SRS_HTTPAPIEXSAS_06_006: [HTTAPIEX_SAS_Destroy shall deallocate any structures denoted by the parameter handle.]*/
         if (state->key)
@@ -159,5 +159,5 @@
                         /*Codes_SRS_HTTPAPIEXSAS_06_011: [SASToken_Create shall be invoked.]*/
                         /*Codes_SRS_HTTPAPIEXSAS_06_012: [If the return result of SASToken_Create is NULL then fallthrough.]*/
-                        size_t expiry = (size_t)(difftime(currentTime, 0) + 3600);
+                        uint64_t expiry = (uint64_t)(difftime(currentTime, 0) + 3600);
                         newSASToken = SASToken_CreateString(state->key, state->uriResource, state->keyName, expiry);
                     }
Index: azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/sastoken.c
===================================================================
--- azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/sastoken.c	(revision 457)
+++ azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/sastoken.c	(revision 464)
@@ -24,5 +24,5 @@
         if (expiryASCII[i] >= '0' && expiryASCII[i] <= '9')
         {
-            value = value * 10 + (double)(expiryASCII[i] - '0');
+            value = value * 10 + ((double)expiryASCII[i] - (double)'0');
         }
         else
@@ -203,5 +203,5 @@
 }
 
-static STRING_HANDLE construct_sas_token(const char* key, const char* scope, const char* keyname, size_t expiry)
+static STRING_HANDLE construct_sas_token(const char* key, const char* scope, const char* keyname, uint64_t expiry)
 {
     STRING_HANDLE result;
@@ -221,5 +221,5 @@
     {
         /*Codes_SRS_SASTOKEN_06_026: [If the conversion to string form fails for any reason then SASToken_Create shall return NULL.]*/
-        if (size_tToString(tokenExpirationTime, sizeof(tokenExpirationTime), expiry) != 0)
+        if (uint64_tToString(tokenExpirationTime, sizeof(tokenExpirationTime), expiry) != 0)
         {
             LogError("For some reason converting seconds to a string failed.  No SAS can be generated.");
@@ -303,5 +303,5 @@
 }
 
-STRING_HANDLE SASToken_Create(STRING_HANDLE key, STRING_HANDLE scope, STRING_HANDLE keyName, size_t expiry)
+STRING_HANDLE SASToken_Create(STRING_HANDLE key, STRING_HANDLE scope, STRING_HANDLE keyName, uint64_t expiry)
 {
     STRING_HANDLE result;
@@ -326,5 +326,5 @@
 }
 
-STRING_HANDLE SASToken_CreateString(const char* key, const char* scope, const char* keyName, size_t expiry)
+STRING_HANDLE SASToken_CreateString(const char* key, const char* scope, const char* keyName, uint64_t expiry)
 {
     STRING_HANDLE result;
Index: azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/sha384-512.c
===================================================================
--- azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/sha384-512.c	(revision 457)
+++ azure_iot_hub_f767zi/trunk/azure_iot_sdk/c-utility/src/sha384-512.c	(revision 464)
@@ -469,4 +469,7 @@
     if (!length)
         return shaSuccess;
+    
+    if (length > (sizeof(context->Message_Block) / sizeof(context->Message_Block[0])))
+        return shaBadParam;
 
     if (!context || !message_array)
