Skip to content

Commit

Permalink
libvncserver: encodings: prevent OOB accesses
Browse files Browse the repository at this point in the history
  • Loading branch information
tobydox committed May 28, 2020
1 parent 4616de6 commit 74e8a70
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libvncserver/corre.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ subrectEncode##bpp(rfbClientPtr client, uint##bpp##_t *data, int w, int h) {
seg = data+(j*w); \
if (seg[x] != cl) {break;} \
i = x; \
while ((seg[i] == cl) && (i < w)) i += 1; \
while ((i < w) && (seg[i] == cl)) i += 1; \
i -= 1; \
if (j == y) vx = hx = i; \
if (i < vx) vx = i; \
Expand Down
2 changes: 1 addition & 1 deletion libvncserver/hextile.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ subrectEncode##bpp(rfbClientPtr cl, uint##bpp##_t *data, int w, int h,
seg = data+(j*w); \
if (seg[x] != cl2) {break;} \
i = x; \
while ((seg[i] == cl2) && (i < w)) i += 1; \
while ((i < w) && (seg[i] == cl2)) i += 1; \
i -= 1; \
if (j == y) vx = hx = i; \
if (i < vx) vx = i; \
Expand Down
2 changes: 1 addition & 1 deletion libvncserver/rre.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ static int \
seg = data+(j*w); \
if (seg[x] != cl) {break;} \
i = x; \
while ((seg[i] == cl) && (i < w)) i += 1; \
while ((i < w) && (seg[i] == cl)) i += 1; \
i -= 1; \
if (j == y) vx = hx = i; \
if (i < vx) vx = i; \
Expand Down

0 comments on commit 74e8a70

Please sign in to comment.