[Git][ghc/ghc][wip/angerman/no-null-deref] Update PEi386.c
Moritz Angermann (@angerman)
gitlab at gitlab.haskell.org
Thu Oct 12 02:00:19 UTC 2023
Moritz Angermann pushed to branch wip/angerman/no-null-deref at Glasgow Haskell Compiler / GHC
Commits:
5ee4a8c8 by Moritz Angermann at 2023-10-12T02:00:06+00:00
Update PEi386.c
- - - - -
1 changed file:
- rts/linker/PEi386.c
Changes:
=====================================
rts/linker/PEi386.c
=====================================
@@ -1775,6 +1775,9 @@ ocGetNames_PEi386 ( ObjectCode* oc )
targetSection = NULL;
break;
default:
+ // targetSecNumber is a uint32_t, and the 0 case should be caught by PE_SECTION_UNDEFINED.
+ // The compiler should be smart enough to eliminate the guard, we'll keep it in as fail
+ // safe nontheless.
targetSection = targetSecNumber > 0 ? &oc->sections[targetSecNumber-1] : NULL;
}
if(NULL != targetSection)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5ee4a8c88720e98a58a80eca5b34a22ca5db4c0f
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5ee4a8c88720e98a58a80eca5b34a22ca5db4c0f
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20231011/334a0df0/attachment.html>
More information about the ghc-commits
mailing list