Anonymous avatar Anonymous committed cc297d4

Fix a possible crash with SSL connections closing early.
libratbox r25356 (jilles)

Comments (0)

Files changed (1)

libratbox/src/openssl.c

 	int ssl_err;
 	lrb_assert(F->accept != NULL);
 	int flags;
+	struct acceptdata *ad;
 
 	if(!SSL_is_init_finished((SSL *) F->ssl))
 	{
 	}
 	rb_settimeout(F, 0, NULL, NULL);
 	rb_setselect(F, RB_SELECT_READ | RB_SELECT_WRITE, NULL, NULL);
-                                                                
-	F->accept->callback(F, RB_OK, (struct sockaddr *) &F->accept->S, F->accept->addrlen,
-			    F->accept->data);
-	rb_free(F->accept);
+	
+	ad = F->accept;
 	F->accept = NULL;
+	ad->callback(F, RB_OK, (struct sockaddr *) &ad->S, ad->addrlen,
+			    ad->data);
+	rb_free(ad);
 
 }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.