Skip to content

Commit ffe9ac9

Browse files
committed
Coverity CID 468130
g_bitmask_to_str() can return < 0 on error. This is not adequately catered for.
1 parent 417076b commit ffe9ac9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libxrdp/xrdp_iso.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protocol_mask_to_str(int protocol, char *buff, int bufflen)
6868
/* String is empty */
6969
rlen = g_snprintf(buff, bufflen, "RDP");
7070
}
71-
else if (rlen < bufflen)
71+
else if (rlen > 0 && rlen < bufflen)
7272
{
7373
rlen += g_snprintf(buff + rlen, bufflen - rlen, "%cRDP", delim);
7474
}

0 commit comments

Comments
 (0)