Skip to content

Commit

Permalink
HOTFIX: fixed critical bug that causes unallocated memory access in c…
Browse files Browse the repository at this point in the history
…url callback function
  • Loading branch information
imperzer0 committed Oct 31, 2023
1 parent 952ec64 commit 1bde5a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

pkgname=webserver
pkgver=2.8
pkgrel=1
pkgrel=2
pkgdesc='Lightweight c++ web server for archlinux with ftp'
author="imperzer0"
arch=('any')
Expand Down
2 changes: 1 addition & 1 deletion server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static size_t custom_curl_read_callback(void* buffer, size_t size, size_t nmemb,

size_t len = std::min(upload->message.size() - upload->pos, size * nmemb);

memcpy(buffer, upload->message.c_str() + upload->pos, size * nmemb);
memcpy(buffer, upload->message.c_str() + upload->pos, len);
upload->pos += len;

return len;
Expand Down

0 comments on commit 1bde5a4

Please sign in to comment.