-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segmentation Fault #82
Labels
Comments
Decent valgrind log thanks to aam:
|
aam simulator 2016 diff --git a/lib/ssl_gnutls.c b/lib/ssl_gnutls.c
index d720095..9422340 100644
--- a/lib/ssl_gnutls.c
+++ b/lib/ssl_gnutls.c
@@ -344,16 +344,22 @@ static gboolean ssl_connected(gpointer data, gint source, b_input_condition cond
static gboolean ssl_handshake(gpointer data, gint source, b_input_condition cond)
{
struct scd *conn = data;
int st, stver;
/* This function returns false, so avoid calling b_event_remove again */
conn->inpa = -1;
+ if (rand() < (RAND_MAX * 0.5)) {
+ conn->func(conn->data, 0, NULL, cond);
+ ssl_disconnect(conn);
+ return FALSE;
+ }
+
if ((st = gnutls_handshake(conn->session)) < 0) {
if (st == GNUTLS_E_AGAIN || st == GNUTLS_E_INTERRUPTED) {
conn->inpa = b_input_add(conn->fd, ssl_getdirection(conn),
ssl_handshake, data);
} else {
conn->func(conn->data, 0, NULL, cond);
ssl_disconnect(conn); |
ty |
1 similar comment
ty |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: