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

libtelnet: Allow compile time stack use control #68

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
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
8 changes: 6 additions & 2 deletions libtelnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
# include <zlib.h>
#endif

#ifndef VPRINTF_STACK
# define VPRINTF_STACK 1024
#endif

#include "libtelnet.h"

/* inlinable functions */
Expand Down Expand Up @@ -1465,7 +1469,7 @@ void telnet_begin_compress2(telnet_t *telnet) {
/* send formatted data with \r and \n translation in addition to IAC IAC */
int telnet_vprintf(telnet_t *telnet, const char *fmt, va_list va) {
va_list va_temp;
char buffer[1024];
char buffer[VPRINTF_STACK];
char *output = buffer;
unsigned int rs, i, l;

Expand Down Expand Up @@ -1537,7 +1541,7 @@ int telnet_printf(telnet_t *telnet, const char *fmt, ...) {
/* send formatted data through telnet_send */
int telnet_raw_vprintf(telnet_t *telnet, const char *fmt, va_list va) {
va_list va_temp;
char buffer[1024];
char buffer[VPRINTF_STACK];
char *output = buffer;
unsigned int rs;

Expand Down