summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 809071662d..b74c08991a 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3132,7 +3132,7 @@ int this_is_smp(void)
char *get_safe_offset(const char *buf_base, size_t buf_len, char *ptr, size_t off)
{
const char *end_base = buf_base + buf_len;
- const char *end_ptr = ptr + off;
+ char *end_ptr = ptr + off;
if (!buf_base || !ptr) {
return NULL;
@@ -3143,7 +3143,7 @@ char *get_safe_offset(const char *buf_base, size_t buf_len, char *ptr, size_t of
}
if (end_ptr < end_base) {
- return ptr;
+ return end_ptr;
}
return NULL;
}