1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-29 10:16:38 +02:00

Fix OOB read (1 byte to the left)

This commit is contained in:
Bram Matthys
2018-06-11 08:05:14 +02:00
parent ad63a499e1
commit 46a60ec795
+1 -1
View File
@@ -695,7 +695,7 @@ void make_mode_str(aChannel *chptr, long oldm, Cmode_t oldem, long oldl, int pco
chptr->mode.extmode = oldem;
}
z = strlen(para_buf);
if (para_buf[z - 1] == ' ')
if ((z > 0) && (para_buf[z - 1] == ' '))
para_buf[z - 1] = '\0';
*x = '\0';
if (*mode_buf == '\0')