From c36b9cd1fc8d94bcd607301dd3d2e7f8cb841648 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 22 Jul 2024 13:12:15 -0400 Subject: [PATCH] fix crash in servePut when client sends from too high offset Have to consume all the content from the client, but force an Invalid result, so it will just get discarded. --- P2P/Http.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/P2P/Http.hs b/P2P/Http.hs index 8317f89611..d6546c11a0 100644 --- a/P2P/Http.hs +++ b/P2P/Http.hs @@ -575,9 +575,9 @@ servePut st resultmangle su apiver (DataLength len) (B64Key k) cu bypass baf mof (L.drop (fromIntegral offsetdelta) content) validitycheck LT -> sendContent' nullMeterUpdate - (Len 0) - mempty - (return Invalid) + (Len len) + content + (validitycheck >>= \_ -> return Invalid) offset = case moffset of Just (Offset o) -> o -- 2.30.2