Skip to content

Commit

Permalink
Merge pull request #2597 from kenballus/master
Browse files Browse the repository at this point in the history
Avoid strncpy from null in pyloader
  • Loading branch information
xrmx authored Feb 8, 2024
2 parents bd25b0a + c4ecde0 commit db31b77
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/python/pyloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ int init_uwsgi_app(int loader, void *arg1, struct wsgi_request *wsgi_req, PyThre
memset(wi, 0, sizeof(struct uwsgi_app));
wi->modifier1 = python_plugin.modifier1;
wi->mountpoint_len = wsgi_req->appid_len < 0xff ? wsgi_req->appid_len : (0xff-1);
strncpy(wi->mountpoint, wsgi_req->appid, wi->mountpoint_len);
if (wi->mountpoint_len > 0) {
strncpy(wi->mountpoint, wsgi_req->appid, wi->mountpoint_len);
}

// dynamic chdir ?
if (wsgi_req->chdir_len > 0) {
Expand Down

0 comments on commit db31b77

Please sign in to comment.