Skip to content

Commit

Permalink
buffer overrun in printf fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
openshwprojects committed Aug 13, 2022
1 parent be6f6c3 commit 0cee105
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/httpserver/http_fns.c
Expand Up @@ -1110,7 +1110,9 @@ int http_fn_startup_command(http_request_t *request) {
"You can use them to init peripherals and drivers, like BL0942 energy sensor</h5>");

if(http_getArg(request->url,"data",tmpA,sizeof(tmpA))) {
hprintf128(request,"<h3>Set command to %s!</h3>",tmpA);
// hprintf128(request,"<h3>Set command to %s!</h3>",tmpA);
// tmpA can be longer than 128 bytes and this would crash
hprintf128(request,"<h3>Command changed!</h3>");
CFG_SetShortStartupCommand(tmpA);

CFG_Save_IfThereArePendingChanges();
Expand Down

0 comments on commit 0cee105

Please sign in to comment.