Bug#994676: gdisk FTBFS: error: format not a string literal and no format arguments [-Werror=format-security]

2022-04-10 Thread Rod Smith
Thanks for the bug report and patch. I've added the patch referenced in
this bug report to the GPT fdisk git repository. I expect to make a new
1.0.9 release with this fix in the next few days.

https://sourceforge.net/p/gptfdisk/code/ci/4be26d7228a5dadfd04488618f08a29f0c67dd8c/

-- 
Rod Smith
rodsm...@rodsbooks.com
http://www.rodsbooks.com



Bug#994676: gdisk FTBFS: error: format not a string literal and no format arguments [-Werror=format-security]

2021-10-13 Thread Sven Joachim
Control: tags -1 + patch bookworm sid

Am 19.09.2021 um 09:13 schrieb Helmut Grohne:

> Source: gdisk
> Version: 1.0.8-3
> Severity: serious
> Tags: ftbfs
>
>
> gdisk fails to build from source in unstable on amd64. A build ends as
> follows:
>
> | x86_64-linux-gnu-g++ -g -O2
> | -ffile-prefix-map=/<>=. -fstack-protector-strong
> | -Wformat -Werror=format-security -Wall -D_FILE_OFFSET_BITS=64
> | -Wdate-time -D_FORTIFY_SOURCE=2 -c -o gptcurses.o gptcurses.cc
> | gptcurses.cc: In member function ‘Space* GPTDataCurses::ShowSpace(int, 
> int)’:
> | gptcurses.cc:242:87: error: format not a string literal and no format 
> arguments [-Werror=format-security]
> |   242 |  printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), 
> blockSize).c_str());
> |   | 
>   ^
> | gptcurses.cc:249:87: error: format not a string literal and no format 
> arguments [-Werror=format-security]
> |   249 |  printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), 
> blockSize).c_str());
> |   | 
>   ^
> | gptcurses.cc:251:55: error: format not a string literal and no format 
> arguments [-Werror=format-security]
> |   251 |  printw(space->origPart->GetTypeName().c_str());
> |   |   ^
> | gptcurses.cc:257:58: error: format not a string literal and no format 
> arguments [-Werror=format-security]
> |   257 |  printw(space->origPart->GetDescription().c_str());
> |   |  ^
> | gptcurses.cc: In member function ‘int GPTDataCurses::DisplayParts(int)’:
> | gptcurses.cc:274:26: error: format not a string literal and no format 
> arguments [-Werror=format-security]
> |   274 |printw(theLine.c_str());
> |   |  ^
> | gptcurses.cc:277:26: error: format not a string literal and no format 
> arguments [-Werror=format-security]
> |   277 |printw(theLine.c_str());
> |   |  ^
> | gptcurses.cc: In member function ‘void GPTDataCurses::ShowInfo(int)’:
> | gptcurses.cc:336:29: warning: format ‘%lld’ expects argument of type
> | ‘long long int’, but argument 2 has type ‘uint64_t’ {aka ‘long
> | unsigned int’} [-Wformat=]
> |   336 |printw("First sector: %lld (at %s)\n", 
> partitions[partNum].GetFirstLBA(),
> |   |  ~~~^ 
> ~
> |   | |   
>  |
> |   | long long int   
>  uint64_t {aka long unsigned int}
> |   |  %ld
> | gptcurses.cc:338:28: warning: format ‘%lld’ expects argument of type
> | ‘long long int’, but argument 2 has type ‘uint64_t’ {aka ‘long
> | unsigned int’} [-Wformat=]
> |   338 |printw("Last sector: %lld (at %s)\n", 
> partitions[partNum].GetLastLBA(),
> |   | ~~~^ 
> 
> |   ||
>|
> |   |long long int
>uint64_t {aka long unsigned int}
> |   | %ld
> | gptcurses.cc:341:31: warning: format ‘%lld’ expects argument of type
> | ‘long long int’, but argument 2 has type ‘uint64_t’ {aka ‘long
> | unsigned int’} [-Wformat=]
> |   341 |printw("Partition size: %lld sectors (%s)\n", size, 
> BytesToIeee(size, blockSize).c_str());
> |   |~~~^  
> |   |   |  |
> |   |   long long int  uint64_t {aka long 
> unsigned int}
> |   |%ld
> | gptcurses.cc:342:33: warning: format ‘%x’ expects argument of type
> | ‘unsigned int’, but argument 2 has type ‘uint64_t’ {aka ‘long
> | unsigned int’} [-Wformat=]
> |   342 |printw("Attribute flags: %016x\n", 
> partitions[partNum].GetAttributes().GetAttributes());
> |   | ^ 
> ~~~
> |   | |   
>|
> |   | unsigned int uint64_t {aka
> |   | long unsigned int}
> |   | %016lx
> | gptcurses.cc: In member function ‘void GPTDataCurses::MakeNewPart()’:
> | gptcurses.cc:444:32: warning: format ‘%lld’ expects argument of type
> | ‘long long int’, but argument 2 has type ‘uint64_t’ {aka ‘long
> | unsigned int’} [-Wformat=]
> |   444 |   printw("First sector (%lld-%lld, default = %lld): ", 
> newFirstLBA, currentSpace->lastLBA, newFirstLBA);
> |   | 

Bug#994676: gdisk FTBFS: error: format not a string literal and no format arguments [-Werror=format-security]

2021-09-19 Thread Helmut Grohne
Source: gdisk
Version: 1.0.8-3
Severity: serious
Tags: ftbfs


gdisk fails to build from source in unstable on amd64. A build ends as
follows:

| x86_64-linux-gnu-g++ -g -O2 -ffile-prefix-map=/<>=. 
-fstack-protector-strong -Wformat -Werror=format-security -Wall 
-D_FILE_OFFSET_BITS=64 -Wdate-time -D_FORTIFY_SOURCE=2  -c -o gptcurses.o 
gptcurses.cc
| gptcurses.cc: In member function ‘Space* GPTDataCurses::ShowSpace(int, int)’:
| gptcurses.cc:242:87: error: format not a string literal and no format 
arguments [-Werror=format-security]
|   242 |  printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), 
blockSize).c_str());
|   |   
^
| gptcurses.cc:249:87: error: format not a string literal and no format 
arguments [-Werror=format-security]
|   249 |  printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), 
blockSize).c_str());
|   |   
^
| gptcurses.cc:251:55: error: format not a string literal and no format 
arguments [-Werror=format-security]
|   251 |  printw(space->origPart->GetTypeName().c_str());
|   |   ^
| gptcurses.cc:257:58: error: format not a string literal and no format 
arguments [-Werror=format-security]
|   257 |  printw(space->origPart->GetDescription().c_str());
|   |  ^
| gptcurses.cc: In member function ‘int GPTDataCurses::DisplayParts(int)’:
| gptcurses.cc:274:26: error: format not a string literal and no format 
arguments [-Werror=format-security]
|   274 |printw(theLine.c_str());
|   |  ^
| gptcurses.cc:277:26: error: format not a string literal and no format 
arguments [-Werror=format-security]
|   277 |printw(theLine.c_str());
|   |  ^
| gptcurses.cc: In member function ‘void GPTDataCurses::ShowInfo(int)’:
| gptcurses.cc:336:29: warning: format ‘%lld’ expects argument of type ‘long 
long int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} 
[-Wformat=]
|   336 |printw("First sector: %lld (at %s)\n", 
partitions[partNum].GetFirstLBA(),
|   |  ~~~^ 
~
|   | | 
   |
|   | long long int 
   uint64_t {aka long unsigned int}
|   |  %ld
| gptcurses.cc:338:28: warning: format ‘%lld’ expects argument of type ‘long 
long int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} 
[-Wformat=]
|   338 |printw("Last sector: %lld (at %s)\n", 
partitions[partNum].GetLastLBA(),
|   | ~~~^ 

|   ||  
 |
|   |long long int  
 uint64_t {aka long unsigned int}
|   | %ld
| gptcurses.cc:341:31: warning: format ‘%lld’ expects argument of type ‘long 
long int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} 
[-Wformat=]
|   341 |printw("Partition size: %lld sectors (%s)\n", size, 
BytesToIeee(size, blockSize).c_str());
|   |~~~^  
|   |   |  |
|   |   long long int  uint64_t {aka long 
unsigned int}
|   |%ld
| gptcurses.cc:342:33: warning: format ‘%x’ expects argument of type ‘unsigned 
int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} [-Wformat=]
|   342 |printw("Attribute flags: %016x\n", 
partitions[partNum].GetAttributes().GetAttributes());
|   | ^ 
~~~
|   | | 
 |
|   | unsigned int  
 uint64_t {aka long unsigned int}
|   | %016lx
| gptcurses.cc: In member function ‘void GPTDataCurses::MakeNewPart()’:
| gptcurses.cc:444:32: warning: format ‘%lld’ expects argument of type ‘long 
long int’, but argument 2 has type ‘uint64_t’ {aka ‘long unsigned int’} 
[-Wformat=]
|   444 |   printw("First sector (%lld-%lld, default = %lld): ", 
newFirstLBA, currentSpace->lastLBA, newFirstLBA);
|   | ~~~^   ~~~
|   ||   |
|   |long long int   uint64_t 
{aka long unsigned int}
|   |