commit ec02d4fbdab241ffd3b5656c46c84a4952c9db51f87f045823466be4253abecb from: Stefan Sperling date: Tue Jul 22 08:13:39 2025 UTC avoid clobbering earlier errors in got_delta_apply and got_delta_apply_in_mem ok op@ commit - d584927da52e61bdcaf302f4183ceb954d626c197b829854392e22a1ab01e07c commit + ec02d4fbdab241ffd3b5656c46c84a4952c9db51f87f045823466be4253abecb blob - 9969ed9f10d981753ab4cb9755f7b1d7c0254b596d4ca5ed4aa70bdb2b8042e2 blob + 4807eeb33304e704f50654c4c4e00782af07e195c196182c37674f9b36fe1e22 --- lib/delta.c +++ lib/delta.c @@ -320,7 +320,7 @@ got_delta_apply_in_mem(uint8_t *base_buf, size_t base_ } } - if (*outsize != result_size) + if (err == NULL && *outsize != result_size) err = got_error_msg(GOT_ERR_BAD_DELTA, "delta application result size mismatch"); return err; @@ -387,12 +387,12 @@ got_delta_apply(FILE *base_file, const uint8_t *delta_ } } - if (*outsize != result_size) + if (err == NULL && *outsize != result_size) err = got_error_msg(GOT_ERR_BAD_DELTA, "delta application result size mismatch"); if (memstream != NULL) { - if (fclose(memstream) == EOF) + if (fclose(memstream) == EOF && err == NULL) err = got_error_from_errno("fclose"); if (err == NULL) { size_t n;