X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Fdemos%2FFractals%2Ffractals.c;fp=progs%2Fdemos%2FFractals%2Ffractals.c;h=3749f16ea4610d4bf6eae752241031fb4e2315b7;hb=ff964fb579513b840f04b31296945f85257fc838;hp=644b33724a63690d332d09458944e89489e00d62;hpb=1fdf3d47e17bb436f139c8a69ee28d36a881820d;p=freeglut diff --git a/progs/demos/Fractals/fractals.c b/progs/demos/Fractals/fractals.c index 644b337..3749f16 100644 --- a/progs/demos/Fractals/fractals.c +++ b/progs/demos/Fractals/fractals.c @@ -206,7 +206,12 @@ void readConfigFile ( char *fnme ) /* Read the window title */ fgets ( inputline, 256, fptr ) ; - sscanf ( inputline, "%[a-zA-Z0-9!@#$%^&*()+=/\\_-\" ]", window_title ) ; + /* We assume here that this line will not exceed 79 characters plus a + newline (window_title is 80 characters long). That'll cause a buffer + overflow. For a simple program like this, though, we're letting it + slide! + */ + sscanf ( inputline, "%[a-zA-Z0-9!@#$%^&*()+=/\\_-\" ]", window_title ) ; /* Read a comment line */ fgets ( inputline, 256, fptr ) ;