MCPcopy Create free account
hub / github.com/containers/bubblewrap / xmul

Function xmul

utils.c:986–1000  ·  view source on GitHub ↗

* Return a * b if it would not overflow. * Die with an "out of memory" error if it would. */

Source from the content-addressed store, hash-verified

984 * Die with an "out of memory" error if it would.
985 */
986static size_t
987xmul (size_t a, size_t b)
988{
989#if defined(__GNUC__) && __GNUC__ >= 5
990 size_t result;
991 if (__builtin_mul_overflow (a, b, &result))
992 die_oom ();
993 return result;
994#else
995 if (b != 0 && a > SIZE_MAX / b)
996 die_oom ();
997
998 return a * b;
999#endif
1000}
1001
1002void
1003strappend (StringBuilder *dest, const char *src)

Callers 3

strappendFunction · 0.85
strappendfFunction · 0.85

Calls 1

die_oomFunction · 0.85

Tested by

no test coverage detected