@@ -1208,6 +1208,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp,
1208120812091209 if (* dcsp != NULL ) {
12101210 error_f ("%s already set" , ext_name );
1211+ r = SSH_ERR_INVALID_FORMAT ;
12111212 goto out ;
12121213 }
12131214 if ((r = sshbuf_froms (m , & b )) != 0 ) {
@@ -1217,6 +1218,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp,
12171218 while (sshbuf_len (b ) != 0 ) {
12181219 if (* ndcsp >= AGENT_MAX_DEST_CONSTRAINTS ) {
12191220 error_f ("too many %s constraints" , ext_name );
1221+ r = SSH_ERR_INVALID_FORMAT ;
12201222 goto out ;
12211223 }
12221224 * dcsp = xrecallocarray (* dcsp , * ndcsp , * ndcsp + 1 ,
@@ -1234,6 +1236,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp,
12341236 }
12351237 if (* certs != NULL ) {
12361238 error_f ("%s already set" , ext_name );
1239+ r = SSH_ERR_INVALID_FORMAT ;
12371240 goto out ;
12381241 }
12391242 if ((r = sshbuf_get_u8 (m , & v )) != 0 ||
@@ -1245,6 +1248,7 @@ parse_key_constraint_extension(struct sshbuf *m, char **sk_providerp,
12451248 while (sshbuf_len (b ) != 0 ) {
12461249 if (* ncerts >= AGENT_MAX_EXT_CERTS ) {
12471250 error_f ("too many %s constraints" , ext_name );
1251+ r = SSH_ERR_INVALID_FORMAT ;
12481252 goto out ;
12491253 }
12501254 * certs = xrecallocarray (* certs , * ncerts , * ncerts + 1 ,
@@ -1741,6 +1745,7 @@ process_ext_session_bind(SocketEntry *e)
17411745 /* record new key/sid */
17421746 if (e -> nsession_ids >= AGENT_MAX_SESSION_IDS ) {
17431747 error_f ("too many session IDs recorded" );
1748+ r = -1 ;
17441749 goto out ;
17451750 }
17461751 e -> session_ids = xrecallocarray (e -> session_ids , e -> nsession_ids ,
0 commit comments