فهرست منبع

Fix a bug that was overwritten the read buffer.

mingodad 9 سال پیش
والد
کامیت
eb19cf678a
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      myaxtls/openssl.c

+ 1 - 1
myaxtls/openssl.c

@@ -154,7 +154,7 @@ int SSL_read(SSL *ssl, void *buf, int num)
 
     if (ret > SSL_OK)
     {
-        memcpy(buf, read_buf, ret);
+        memcpy(buf, read_buf, ret > num ? num : ret);
     }
 
     return ret;