1Author: Ulf Härnhammar <Ulf.Harnhammar.9485@student.uu.se>
2Description: Fixes buffer overflows while loading the config file.
3Bug-Debian: http://bugs.debian.org/290822
4--- a/src/KommandoZeilenParameter.cpp
5+++ b/src/KommandoZeilenParameter.cpp
7 void SchreibeKonfiguration(){
11- sprintf(dateiname,"%s/.BillardGL.conf.v7",getenv("HOME"));
13+ snprintf(dateiname,sizeof(dateiname),"%s/.BillardGL.conf.v7",getenv("HOME"));
14 f=fopen(dateiname,"w+");
18 void LeseKonfiguration(){
22- sprintf(dateiname,"%s/.BillardGL.conf.v7",getenv("HOME"));
24+ snprintf(dateiname,sizeof(dateiname),"%s/.BillardGL.conf.v7",getenv("HOME"));
25 f=fopen(dateiname,"r");
29 fscanf(f,"%i",&GrueneLampe);
30 fscanf(f,"%f",&EffektLautstaerke);
31 fscanf(f,"%f",&MusikLautstaerke);
32- fscanf(f,"%s",Spieler1temp);
33- fscanf(f,"%s",Spieler2temp);
34- fscanf(f,"%s",NetzwerkSpielertemp);
35+ fscanf(f,"%9s",Spieler1temp);
36+ fscanf(f,"%9s",Spieler2temp);
37+ fscanf(f,"%9s",NetzwerkSpielertemp);
38 for (int i=0;i<10;i++) {
39 if (Spieler1temp[i]=='%') {
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list