diff --git a/programs/ssl/ssl_server2.c b/programs/ssl/ssl_server2.c
index 27f2312305..d23a700f85 100644
--- a/programs/ssl/ssl_server2.c
+++ b/programs/ssl/ssl_server2.c
@@ -1820,7 +1820,7 @@ int main( int argc, char *argv[] )
 #endif
 #if defined(MBEDTLS_SSL_CONTEXT_SERIALIZATION)
     unsigned char *context_buf = NULL;
-    size_t context_buf_len;
+    size_t context_buf_len = 0;
 #endif
 
     int i;