bitmanipulation: fix undefined behavior in bit shift in getbe32
OSS-Fuzz caught this in its ubsan mode[0]. I'm not worried about a
security issue here because in practice this should work out the way
we naively expected, we're just making things explicit to the
compiler with the casts.
0: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8876
Differential Revision: https://phab.mercurial-scm.org/D3729
lazymanifest: don't crash when out of memory (
issue5916)
self->lines can be NULL if we failed to allocate memory for it.
cext: stop worrying and love the free(NULL)
There is no need to check for a NULL pointer before calling free since
free(NULL) is defined by C standards as a no-op. Lots of software relies on
this behavior so it is completely safe to call even on the most obscure of
systems.