diff options
author | Revo <projectrevotpp@hotmail.com> | 2020-05-27 10:18:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-27 10:18:12 -0400 |
commit | f33c888bab897bbed7682ff2a190c1a7d48e99e8 (patch) | |
tree | c1e1d30574a09e8f88aa2de0e8345ea89ad1fb1e | |
parent | bffd222841fa7de980bff99a7d34ccf97344d58a (diff) | |
parent | fafa7f0dccbd910af75412cc9e4fa606b504c7de (diff) |
Merge pull request #117 from PikalaxALT/pikalax_work
Updates to calcrom/webhook
-rw-r--r-- | .travis.yml | 2 | ||||
-rw-r--r-- | .travis/calcrom/calcrom.cpp | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml index 681bddc5..5ce0b5e9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,4 +33,4 @@ notifications: email: false after_success: - - .travis/calcrom/webhook.sh + - .travis/calcrom/webhook.sh pokediamond diff --git a/.travis/calcrom/calcrom.cpp b/.travis/calcrom/calcrom.cpp index fe43939a..272bcf17 100644 --- a/.travis/calcrom/calcrom.cpp +++ b/.travis/calcrom/calcrom.cpp @@ -11,10 +11,12 @@ * - Must be placed in ".travis/calcrom/". * * Changelog: - * - 1.0.0 (26 May 2020): + * - 0.1.0 (26 May 2020): * Initial implementation - * - 1.0.1 (26 May 2020): + * - 0.1.1 (26 May 2020): * Allow program to be run from wherever + * 0.1.2 (27 May 2020): + * Extra security on ELF header */ #include <iostream> @@ -74,7 +76,10 @@ int main(int argc, char ** argv) fname_s = fname_s.replace(fname_s.rfind('.'), 4, ".o"); elf.open(fname_s, ios_base::in | ios_base::binary); elf.read((char *)&ehdr, sizeof(ehdr)); - if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0) { + if (memcmp(ehdr.e_ident, ELFMAG, SELFMAG) != 0 + || ehdr.e_ehsize != sizeof(Elf32_Ehdr) + || ehdr.e_shentsize != sizeof(Elf32_Shdr)) + { elf.close(); stringstream ss; ss << "Error validating " << fname_s << " as an ELF file" << endl; |