mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-07 16:28:38 +09:00
Update NSS to 3.32.1-RTM
This commit is contained in:
parent
f29876f120
commit
c91ef9012b
512 changed files with 83203 additions and 16839 deletions
34
security/nss/fuzz/tls_socket.cc
Normal file
34
security/nss/fuzz/tls_socket.cc
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include "prerror.h"
|
||||
#include "prio.h"
|
||||
|
||||
#include "tls_socket.h"
|
||||
|
||||
int32_t DummyPrSocket::Read(PRFileDesc *f, void *data, int32_t len) {
|
||||
assert(data && len > 0);
|
||||
|
||||
int32_t amount = std::min(len, static_cast<int32_t>(len_));
|
||||
memcpy(data, buf_, amount);
|
||||
|
||||
buf_ += amount;
|
||||
len_ -= amount;
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
int32_t DummyPrSocket::Write(PRFileDesc *f, const void *buf, int32_t length) {
|
||||
return length;
|
||||
}
|
||||
|
||||
int32_t DummyPrSocket::Recv(PRFileDesc *f, void *buf, int32_t buflen,
|
||||
int32_t flags, PRIntervalTime to) {
|
||||
assert(flags == 0);
|
||||
return Read(f, buf, buflen);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue