mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-26 02:17:34 +09:00
[NSS] add a defensive check for large ssl_DefSend return values.
This commit is contained in:
parent
580e04c8a8
commit
266b96a53a
1 changed files with 6 additions and 1 deletions
|
|
@ -441,7 +441,12 @@ ssl_SendSavedWriteData(sslSocket *ss)
|
||||||
if (rv < 0) {
|
if (rv < 0) {
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
ss->pendingBuf.len -= rv;
|
if (rv > ss->pendingBuf.len) {
|
||||||
|
PORT_Assert(0); /* This shouldn't happen */
|
||||||
|
ss->pendingBuf.len = 0;
|
||||||
|
} else {
|
||||||
|
ss->pendingBuf.len -= rv;
|
||||||
|
}
|
||||||
if (ss->pendingBuf.len > 0 && rv > 0) {
|
if (ss->pendingBuf.len > 0 && rv > 0) {
|
||||||
/* UGH !! This shifts the whole buffer down by copying it */
|
/* UGH !! This shifts the whole buffer down by copying it */
|
||||||
PORT_Memmove(ss->pendingBuf.buf, ss->pendingBuf.buf + rv,
|
PORT_Memmove(ss->pendingBuf.buf, ss->pendingBuf.buf + rv,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue