mirror of https://github.com/google/gemma.cpp.git
- util/basics.h: Add overflow check in Extents2D::Area() before computing rows*cols. Malicious model files with large dimension values could cause a silent size_t overflow, leading to undersized allocations and subsequent heap buffer overflows. - paligemma/image.cc: Add overflow check for width*height*3 in ReadPPM(). A crafted PPM file with large dimensions could overflow the data_size computation, resulting in an undersized buffer and out-of-bounds writes. - paligemma/image.cc: Add overflow detection in ParseUnsigned() to reject values that would overflow size_t during decimal parsing. |
||
|---|---|---|
| .. | ||
| allocator.cc | ||
| allocator.h | ||
| args.h | ||
| basics.cc | ||
| basics.h | ||
| basics_test.cc | ||
| mat.cc | ||
| mat.h | ||
| test_util.h | ||
| threading.cc | ||
| threading.h | ||
| threading_context.cc | ||
| threading_context.h | ||
| threading_test.cc | ||
| topology.cc | ||
| topology.h | ||
| zones.cc | ||
| zones.h | ||