add a compiler warning fix backport; prepare targetted fixes upload
[alioth/musescore.git] / debian / patches / upstream / sprintf.diff
1 Description: fix possible buffer overflow
2  compiler warning, very unlikely to hit in production
3  .
4  Better fix would be QString::asprintf() but Qt discourages that
5  for some unconceivable reason...
6 Author: mirabilos <m@mirbsd.org>
7 Forwarded: https://github.com/musescore/MuseScore/pull/5202
8 Applied-Upstream: v3.3
9
10 --- a/mscore/playpanel.cpp
11 +++ b/mscore/playpanel.cpp
12 @@ -353,11 +353,11 @@ void PlayPanel::updatePosLabel(int utick
13        // alternative would be to use a monospaced font and a
14        // single label
15            
16 -      char barBuffer[8];
17 +      char barBuffer[12];
18        sprintf(barBuffer, "%d", bar+1);// sprintf(barBuffer, "%03d", bar+1);
19        measureLabel->setText(QString(barBuffer));
20        
21 -      char beatBuffer[8];
22 +      char beatBuffer[12];
23        sprintf(beatBuffer, "%02d", beat+1);
24        beatLabel->setText(QString(beatBuffer));
25        }