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.
This commit is contained in:
Joey Hess 2024-07-22 13:12:15 -04:00
parent b240a11b79
commit c36b9cd1fc
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -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