fix vncproxy on windows 2008 rfb proto parse bug

Uint8 value range out of bounds causes problems in the parsing protocol
This commit is contained in:
wentianle 2018-08-10 01:42:52 +08:00 committed by GitHub
parent f19a75749b
commit a870f3cbb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -142,7 +142,7 @@ func handleTightFilters(subencoding uint8, pixelFmt *common.PixelFormat, rect *c
return
}
paletteSize := colorCount + 1 // add one more
paletteSize := int(colorCount) + 1 // add one more
logger.Debugf("handleTightFilters: ----PALETTE_FILTER: paletteSize=%d bytesPixel=%d\n", paletteSize, bytesPixel)
//complete palette
_, err = r.ReadBytes(int(paletteSize) * bytesPixel)