/* Behave like chunkcopy, but avoid writing beyond of legal output. */
Z_INTERNAL uint8_t* CHUNKCOPY_SAFE(uint8_t *out, uint8_t const *from, unsigned len, uint8_t *safe) {
- len = MIN(len, safe - out + 1);
+ unsigned safelen = (unsigned)((safe - out) + 1);
+ len = MIN(len, safelen);
#if CHUNK_SIZE >= 32
while (len >= 32) {
memcpy(out, from, 32);
if (dist >= len || dist >= state->chunksize)
out = functable.chunkcopy_safe(out, out - dist, len, safe);
else
- out = functable.chunkmemset_safe(out, dist, len, safe - out + 1);
+ out = functable.chunkmemset_safe(out, dist, len, (unsigned)((safe - out) + 1));
} else {
/* Whole reference is in range of current output. No range checks are
necessary because we start with room for at least 258 bytes of output,
$(SHAREDLIB): zconf $(TOP)/win32/$(DEFFILE) $(OBJS) $(RESFILE)
$(LD) $(LDFLAGS) -def:$(TOP)/win32/$(DEFFILE) -dll -implib:$(IMPLIB) \
- -out:$@ -base:0x5A4C0000 $(OBJS) $(RESFILE)
+ -out:$@ $(OBJS) $(RESFILE)
if exist $@.manifest \
mt -nologo -manifest $@.manifest -outputresource:$@;2