diff options
| author | Vladislav Grishenko <themiron@users.noreply.github.com> | 2026-08-02 18:58:25 +0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-02 18:58:25 +0500 |
| commit | f536d692fc1b70d82f7e14a49574066cc3121b28 (patch) | |
| tree | 047a1d763ed707c302c186096ce5b0cdb2a9a366 | |
| parent | 93c6a21673f693640ec8004b063a3471f784f8fa (diff) | |
| parent | fd2cd2bce6328264ce9cb9bc371d7349319724a8 (diff) | |
| download | accel-ppp-f536d692fc1b70d82f7e14a49574066cc3121b28.tar.gz accel-ppp-f536d692fc1b70d82f7e14a49574066cc3121b28.zip | |
Merge pull request #340 from accel-ppp/sstp-alloc-invariant
sstp: express escape buffer bound as one invariant
| -rw-r--r-- | accel-pppd/ctrl/sstp/sstp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/accel-pppd/ctrl/sstp/sstp.c b/accel-pppd/ctrl/sstp/sstp.c index 6c2b9ca9..1ab08a14 100644 --- a/accel-pppd/ctrl/sstp/sstp.c +++ b/accel-pppd/ctrl/sstp/sstp.c @@ -1846,7 +1846,8 @@ static int sstp_recv_data_packet(struct sstp_conn_t *conn, struct sstp_hdr *hdr) buf_put_data(buf, hdr->data, size); #else - buf = alloc_buf(size*2 + 2 + PPP_FCSLEN*2); + /* payload and FCS octets may both double when escaped, plus 2 flags */ + buf = alloc_buf((size + PPP_FCSLEN) * 2 + 2); if (!buf) { log_error("sstp: no memory\n"); return -1; |
