diff --git a/api/oc_endpoint.c b/api/oc_endpoint.c index 16ba8ca4a..785ad5738 100644 --- a/api/oc_endpoint.c +++ b/api/oc_endpoint.c @@ -171,7 +171,10 @@ oc_endpoint_to_cstring(const oc_endpoint_t *endpoint, char *buffer, return -1; } // overflow check for coverity scan - assert(len <= INT_MAX - written && "Integer overflow detected"); + // assert(len <= INT_MAX - written && "Integer overflow detected"); + if (len > INT_MAX - written) { + return -1; + } return len + written; }