mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-24 14:50:10 +01:00
cairo-script: Improve buffer length check
Quells the following warning:
cairo-script-scanner.c: In function ‘_translate_string’:
cairo-script-scanner.c:1623:18: warning: comparison between signed and
unsigned integer expressions [-Wsign-compare]
if (buf_len <= 8 + 2*string->len) {
^
This commit is contained in:
parent
f032133e6d
commit
b9ada81995
1 changed files with 2 additions and 1 deletions
|
|
@ -1620,7 +1620,8 @@ _translate_string (csi_t *ctx,
|
|||
if (uncompress ((Bytef *) buf, &buf_len,
|
||||
(Bytef *) string->string, string->len) == Z_OK)
|
||||
{
|
||||
if (buf_len <= 8 + 2*string->len) {
|
||||
assert(string->len > 0);
|
||||
if (buf_len <= 8 + 2*((unsigned long)string->len)) {
|
||||
method = NONE;
|
||||
deflate = 0;
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue