freeradius/freeradius-dont-truncate-uint64.patch

28 lines
887 B
Diff
Raw Normal View History

2014-09-30 13:25:07 +00:00
From de77beacf1c0bd64335f0f949af9da71437d3ba5 Mon Sep 17 00:00:00 2001
From: Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com>
Date: Tue, 30 Sep 2014 22:27:36 +0300
Subject: [PATCH 1/4] Don't truncate 64-bit integers in do_cast_copy
Assign converted octets to vp_integer64, instead of vp_integer to avoid
truncation in do_cast_copy.
---
src/main/evaluate.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/evaluate.c b/src/main/evaluate.c
index f91d482..5cf597d 100644
--- a/src/main/evaluate.c
+++ b/src/main/evaluate.c
@@ -475,7 +475,7 @@ static int do_cast_copy(VALUE_PAIR *dst, VALUE_PAIR const *src)
do_octets:
switch (dst->da->type) {
case PW_TYPE_INTEGER64:
- dst->vp_integer = ntohll(*(uint64_t const *) src->vp_octets);
+ dst->vp_integer64 = ntohll(*(uint64_t const *) src->vp_octets);
break;
case PW_TYPE_INTEGER:
--
2.1.0