From 26f974616bef3c8a6541221d0ffe97ecfb85f1bf Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 13 Jun 2009 17:43:07 +0000 Subject: [PATCH] shift netgraph up by sbar_info_pos; fix printf vulnerability in terencehill's ctrl-tab code git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9018 d7cf8633-e32d-0410-b094-e92efae38249 --- cl_screen.c | 3 ++- keys.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cl_screen.c b/cl_screen.c index d2f2b0ed..26bd9fc9 100644 --- a/cl_screen.c +++ b/cl_screen.c @@ -59,6 +59,7 @@ cvar_t cl_demo_mousegrab = {0, "cl_demo_mousegrab", "0", "Allows reading the mou extern cvar_t r_glsl; extern cvar_t v_glslgamma; +extern cvar_t sbar_info_pos; #define WANT_SCREENSHOT_HWGAMMA (scr_screenshot_hwgamma.integer && !(r_glsl.integer && v_glslgamma.integer)) int jpeg_supported = false; @@ -305,7 +306,7 @@ void SCR_DrawNetGraph (void) index = 0; netgraph_x = (vid_conwidth.integer + separator2) - (1 + (index % netgraphsperrow)) * (barwidth * NETGRAPH_PACKETS * 2 + separator1 + separator2); - netgraph_y = (vid_conheight.integer - 48 + separator2) - (1 + (index / netgraphsperrow)) * (barheight + textsize + separator2); + netgraph_y = (vid_conheight.integer - 48 - sbar_info_pos.integer + separator2) - (1 + (index / netgraphsperrow)) * (barheight + textsize + separator2); SCR_DrawNetGraph_DrawConnection_Client(cls.netcon, netgraph_x, netgraph_y, barwidth, barheight, bardivide, "incoming", separator1, "outgoing", textsize); index++; diff --git a/keys.c b/keys.c index 3192cdd0..8214d157 100644 --- a/keys.c +++ b/keys.c @@ -512,7 +512,7 @@ Key_Console (int key, int ascii) key_linepos += cvar_len; // save the content of the variable in cvar_str - cvar_str = Cvar_VariableString(va(cvar)); + cvar_str = Cvar_VariableString(cvar); cvar_str_len = strlen(cvar_str); if (cvar_str_len==0) return; -- 2.39.2