MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / Report

Function Report

Library/OcGuardLib/Ubsan.c:1177–1263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1175/* Local utility functions */
1176
1177static void
1178// OC change: EFIAPI is required by EDK2
1179EFIAPI
1180Report(bool isFatal, const char *pFormat, ...)
1181{
1182 va_list ap;
1183
1184 ASSERT(pFormat);
1185
1186 va_start(ap, pFormat);
1187#if defined(_KERNEL)
1188 if (isFatal || alwaysFatal)
1189 vpanic(pFormat, ap);
1190 else
1191 vprintf(pFormat, ap);
1192#else
1193 if (ubsan_flags == -1) {
1194 char buf[1024];
1195 char *p;
1196
1197 ubsan_flags = UBSAN_STDERR;
1198
1199 if (getenv_r("LIBC_UBSAN", buf, sizeof(buf)) != -1) {
1200 for (p = buf; *p; p++) {
1201 switch (*p) {
1202 case 'a':
1203 SET(ubsan_flags, UBSAN_ABORT);
1204 break;
1205 case 'A':
1206 CLR(ubsan_flags, UBSAN_ABORT);
1207 break;
1208 case 'e':
1209 SET(ubsan_flags, UBSAN_STDERR);
1210 break;
1211 case 'E':
1212 CLR(ubsan_flags, UBSAN_STDERR);
1213 break;
1214 case 'l':
1215 SET(ubsan_flags, UBSAN_SYSLOG);
1216 break;
1217 case 'L':
1218 CLR(ubsan_flags, UBSAN_SYSLOG);
1219 break;
1220 case 'o':
1221 SET(ubsan_flags, UBSAN_STDOUT);
1222 break;
1223 case 'O':
1224 CLR(ubsan_flags, UBSAN_STDOUT);
1225 break;
1226 default:
1227 break;
1228 }
1229 }
1230 }
1231 }
1232
1233 // The *v*print* functions can flush the va_list argument.
1234 // Create a local copy for each call to prevent invalid read.

Callers 15

HandleOverflowFunction · 0.70
HandleNegateOverflowFunction · 0.70
HandleBuiltinUnreachableFunction · 0.70
HandleTypeMismatchFunction · 0.70
HandleOutOfBoundsFunction · 0.70
HandleShiftOutOfBoundsFunction · 0.70
HandleImplicitConversionFunction · 0.70
HandleLoadInvalidValueFunction · 0.70
HandleInvalidBuiltinFunction · 0.70
HandleCFIBadTypeFunction · 0.70

Calls 3

vprintfFunction · 0.85
vfprintfFunction · 0.85
abortFunction · 0.50

Tested by

no test coverage detected