Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
ltsm (0.9.2) unstable; urgency=low

* Increased buffersize to 16 MiB

-- Samuel Hasert <[email protected]> Mon, 15 Jul 2025 11:33:05 +0200

ltsm (0.9.1) unstable; urgency=low

* Finalize remove of FSQ project.
Expand Down
4 changes: 3 additions & 1 deletion src/lib/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ int crc32file(const char *filename, uint32_t *crc32result)
FILE *file;
size_t cur_read;
uint32_t crc32sum = 0;
unsigned char buf[TSM_BUF_LENGTH] = {0};
unsigned char* buf = malloc(TSM_BUF_LENGTH); // reserve memory on heap because stack too small

file = fopen(filename, "r");
if (file == NULL) {
Expand Down Expand Up @@ -186,6 +186,8 @@ int crc32file(const char *filename, uint32_t *crc32result)

*crc32result = crc32sum;

free(buf);

return rc;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
#endif

#ifndef TSM_BUF_LENGTH
#define TSM_BUF_LENGTH 262144 /* 256 KiB. */
#define TSM_BUF_LENGTH 16777216 /* 16 MiB */
#endif

#ifndef MAX_OPTIONS_LENGTH
Expand Down
5 changes: 4 additions & 1 deletion src/ltsmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ int main(int argc, char *argv[])
goto cleanup_tsm;
}

char buf[TSM_BUF_LENGTH] = {0};
char* buf = malloc(TSM_BUF_LENGTH);
size_t size;
do {
size = fread(buf, 1, TSM_BUF_LENGTH, stdin);
Expand All @@ -515,9 +515,12 @@ int main(int argc, char *argv[])
if (rc)
CT_ERROR(errno, "tsm_fclose failed");

free(buf);

goto cleanup_tsm;
}


session.progress = progress_callback;

rc = tsm_connect(&login, &session);
Expand Down