File tree 2 files changed +7
-2
lines changed
ogr/ogrsf_frmts/openfilegdb
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -448,8 +448,11 @@ def test_ogr_basic_10():
448
448
if test_cli_utilities .get_test_ogrsf_path () is None :
449
449
pytest .skip ()
450
450
451
+ # --config OPENFILEGDB_REPRODUCIBLE_UUID=YES helps avoiding unsigned-integer-overflow
452
+ # under UBSAN.
451
453
ret = gdaltest .runexternal (
452
- test_cli_utilities .get_test_ogrsf_path () + " -all_drivers"
454
+ test_cli_utilities .get_test_ogrsf_path ()
455
+ + " -all_drivers --config OPENFILEGDB_REPRODUCIBLE_UUID=YES"
453
456
)
454
457
455
458
assert "INFO" in ret
Original file line number Diff line number Diff line change @@ -77,7 +77,9 @@ std::string OFGDBGenerateUUID(bool bInit)
77
77
// from the same seed on all platforms.
78
78
const auto reproducibleRand = [&nCounterLocal]()
79
79
{
80
- nCounterLocal = nCounterLocal * 1103515245U + 12345U ;
80
+ nCounterLocal = static_cast <uint32_t >(
81
+ (static_cast <uint64_t >(nCounterLocal) * 1103515245U + 12345U ) &
82
+ UINT32_MAX);
81
83
return (nCounterLocal / 65536U ) % 32768U ;
82
84
};
83
85
You can’t perform that action at this time.
0 commit comments