Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix CVE-2022-43634 #186

Merged
merged 1 commit into from Feb 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions libatalk/dsi/dsi_write.c
Expand Up @@ -23,15 +23,15 @@
#include <atalk/util.h>
#include <atalk/logger.h>

size_t dsi_writeinit(DSI *dsi, void *buf, const size_t buflen _U_)
size_t dsi_writeinit(DSI *dsi, void *buf, const size_t buflen)
{
size_t bytes = 0;
dsi->datasize = ntohl(dsi->header.dsi_len) - dsi->header.dsi_data.dsi_doff;

if (dsi->eof > dsi->start) {
/* We have data in the buffer */
bytes = MIN(dsi->eof - dsi->start, dsi->datasize);
memmove(buf, dsi->start, bytes);
memmove(buf, dsi->start, MIN(buflen, bytes));
dsi->start += bytes;
dsi->datasize -= bytes;
if (dsi->start >= dsi->eof)
Expand Down