Skip to content

Make sure large buffers are on the heap with SMALL_STACK#10245

Open
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:small_stack
Open

Make sure large buffers are on the heap with SMALL_STACK#10245
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:small_stack

Conversation

@Frauschi
Copy link
Copy Markdown
Contributor

Make sure buffers larger than around 100 bytes are allocated on the heap when WOLFSSL_SMALL_STACK is defined.

Follow-up for zd#21610, fixes zd#21642.

@Frauschi Frauschi self-assigned this Apr 17, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 17, 2026

MemBrowse Memory Report

gcc-arm-cortex-m4

  • FLASH: .text +64 B (+0.0%, 195,403 B / 262,144 B, total: 75% used)

gcc-arm-cortex-m4-min-ecc

@Frauschi
Copy link
Copy Markdown
Contributor Author

Jenkins retest this please

@Frauschi Frauschi assigned wolfSSL-Bot and unassigned Frauschi Apr 18, 2026
Comment thread src/conf.c Outdated
long totalLen = 0;
char buf[512]; /* Should be more than enough for a single row */
char* bufEnd = buf + sizeof(buf);
WC_DECLARE_VAR(buf, char, 512, NULL); /* enough for a single row */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make 512 a #define

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added LINE_BUFFER_SIZE define.

Comment thread wolfcrypt/src/sakke.c Outdated
mp_int* by = key->tmp.p1->z;
mp_int* prime = &key->params.prime;
unsigned char eb[128];
WC_DECLARE_VAR(eb, unsigned char, 128, key->heap);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make #define for 128.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added SAKKE_EB_BUF_SIZE define.

Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fenrir Automated Review — PR #10245

Scan targets checked: wolfcrypt-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src

Findings: 2
2 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread wolfcrypt/src/sakke.c
Comment thread src/ssl.c
@Frauschi
Copy link
Copy Markdown
Contributor Author

Fixed the identified issues

@Frauschi Frauschi removed their assignment Apr 19, 2026
@Frauschi Frauschi requested a review from SparkiDev April 19, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants