summaryrefslogtreecommitdiff
path: root/lib/ext/dumbfw.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ext/dumbfw.c')
-rw-r--r--lib/ext/dumbfw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ext/dumbfw.c b/lib/ext/dumbfw.c
index 7faff65693..4e56192337 100644
--- a/lib/ext/dumbfw.c
+++ b/lib/ext/dumbfw.c
@@ -1,5 +1,6 @@
/*
- * Copyright (C) 2013 Nikos Mavrogiannopoulos
+ * Copyright (C) 2013-2018 Nikos Mavrogiannopoulos
+ * Copyright (C) 2018 Red Hat, Inc.
*
* This file is part of GnuTLS.
*
@@ -57,15 +58,16 @@ _gnutls_dumbfw_send_params(gnutls_session_t session,
int total_size = 0, ret;
uint8_t pad[257];
unsigned pad_size;
+ ssize_t len = extdata->length - sizeof(mbuffer_st);
if (session->security_parameters.entity == GNUTLS_SERVER ||
session->internals.dumbfw == 0 ||
IS_DTLS(session) != 0 ||
- (extdata->length < 256 || extdata->length >= 512)) {
+ (len < 256 || len >= 512)) {
return 0;
} else {
/* 256 <= extdata->length < 512 */
- pad_size = 512 - extdata->length;
+ pad_size = 512 - len;
memset(pad, 0, pad_size);
ret =