"gcc -Werror=format-security" is small-minded
... and does not perform constant propagation modified: src/p_vmlinx.cpp
This commit is contained in:
committed by
Markus F.X.J. Oberhumer
parent
2b8a7a492a
commit
37f27a1262
+2
-6
@@ -116,9 +116,7 @@ typename T::Shdr const *PackVmlinuxBase<T>::getElfSections()
|
|||||||
fi->readx(shdri, e_shnum * sizeof(*shdri));
|
fi->readx(shdri, e_shnum * sizeof(*shdri));
|
||||||
unsigned const e_shstrndx = ehdri.e_shstrndx;
|
unsigned const e_shstrndx = ehdri.e_shstrndx;
|
||||||
if (e_shnum <= e_shstrndx) {
|
if (e_shnum <= e_shstrndx) {
|
||||||
char msg[50]; snprintf(msg, sizeof(msg),
|
infoWarning("bad .e_shstrndx %#x", e_shstrndx);
|
||||||
"bad .e_shstrndx %#x", e_shstrndx);
|
|
||||||
infoWarning(msg);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
Shdr const *p = &shdri[e_shstrndx];
|
Shdr const *p = &shdri[e_shstrndx];
|
||||||
@@ -130,9 +128,7 @@ typename T::Shdr const *PackVmlinuxBase<T>::getElfSections()
|
|||||||
// 10 == (1+ strlen(".shstrtab"))
|
// 10 == (1+ strlen(".shstrtab"))
|
||||||
) {
|
) {
|
||||||
if (p->sh_size <= p->sh_name) {
|
if (p->sh_size <= p->sh_name) {
|
||||||
char msg[50]; snprintf(msg, sizeof(msg),
|
infoWarning("bad .shstrtab _Shdr[%u]", (unsigned)ehdri.e_shstrndx);
|
||||||
"bad .shstrtab _Shdr[%u]", (unsigned)ehdri.e_shstrndx);
|
|
||||||
infoWarning(msg);
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
shstrtab = new char[1+ p->sh_size];
|
shstrtab = new char[1+ p->sh_size];
|
||||||
|
|||||||
Reference in New Issue
Block a user