Address some review feedback comments for supported_versions
[openssl.git] / ssl / statem / statem_lib.c
index a7f2a0f..2aadc77 100644 (file)
@@ -1036,8 +1036,7 @@ int ssl_choose_server_version(SSL *s, CLIENTHELLO_MSG *hello)
         const SSL_METHOD *best_method = NULL;
         PACKET versionslist;
 
-        if (!PACKET_get_length_prefixed_1(&suppversions->data, &versionslist)
-                || PACKET_remaining(&suppversions->data) != 0) {
+        if (!PACKET_as_length_prefixed_1(&suppversions->data, &versionslist)) {
             /* Trailing or invalid data? */
             return SSL_R_LENGTH_MISMATCH;
         }
@@ -1052,7 +1051,8 @@ int ssl_choose_server_version(SSL *s, CLIENTHELLO_MSG *hello)
                 continue;
             for (vent = table;
                  vent->version != 0 && vent->version != (int)candidate_vers;
-                 ++vent);
+                 ++vent)
+                ;
             if (vent->version != 0) {
                 const SSL_METHOD *method;