From 75671fa11c57aa458e87d876efc48b40985ed78f Mon Sep 17 00:00:00 2001 From: SashaXser <24498484+SashaXser@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:19:32 +0400 Subject: [PATCH] Fixes from CodeQL (#223) * Fix code scanning alert no. 4: Multiplication result converted to larger type Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> * Fix code scanning alert no. 5: Multiplication result converted to larger type Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- desync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desync.c b/desync.c index 0259ba2..c63c749 100644 --- a/desync.c +++ b/desync.c @@ -469,7 +469,7 @@ ssize_t desync(int sfd, char *buffer, size_t bfsize, pos += gen_offset(part.pos, part.flag, n - pos - 5, lp, type, host_pos - 5, len); - pos += part.s * (part.r - r); + pos += (long)part.s * (part.r - r); if (pos < lp) { LOG(LOG_E, "tlsrec cancel: %ld < %ld\n", pos, lp); break; @@ -501,7 +501,7 @@ ssize_t desync(int sfd, char *buffer, size_t bfsize, long pos = gen_offset(part.pos, part.flag, n, lp, type, host_pos, len); - pos += part.s * (part.r - r); + pos += (long)part.s * (part.r - r); if (!(part.flag & OFFSET_START) && offset && pos <= offset) { LOG(LOG_S, "offset: %zd, skip\n", offset);