From c8804a16bb390a1532525b385d06db3cab43ba09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9F=D1=80=D0=BE?= =?UTF-8?q?=D1=85=D0=BE=D1=80=D0=BE=D0=B2?= Date: Mon, 20 May 2019 20:49:31 +0200 Subject: [PATCH] Make sure stored "session fingerprint" is not referring larger binary --- src/mtp_session_storage.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mtp_session_storage.erl b/src/mtp_session_storage.erl index 7f9122f..577d3a0 100644 --- a/src/mtp_session_storage.erl +++ b/src/mtp_session_storage.erl @@ -128,7 +128,7 @@ code_change(_OldVsn, State, _Extra) -> fingerprint(<<_:8/binary, KeyIV:(32 + 16)/binary, _:8/binary>>) -> %% It would be better to use whole 64b packet as fingerprint, but will use only %% 48b Key + IV part to save some space. - KeyIV. + binary:copy(KeyIV). bucket(Timestamp) -> Timestamp div ?HISTOGRAM_BUCKET_SIZE.