From d2b0877bd88377fdd3da9b4cb4f763d8a6f831c3 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 10 Aug 2021 10:48:15 +0200 Subject: Merge pull request #2795 from rouault/fix_ossfuzz_36751 Conversion::createUTM(): avoid integer overflow --- scripts/create_c_api_projections.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'scripts/create_c_api_projections.py') diff --git a/scripts/create_c_api_projections.py b/scripts/create_c_api_projections.py index 1682b160..323b54ed 100755 --- a/scripts/create_c_api_projections.py +++ b/scripts/create_c_api_projections.py @@ -167,8 +167,11 @@ for sectiondef in compounddef.iter('sectiondef'): test_cppfile.write("{\n") test_cppfile.write(" auto projCRS = proj_create_conversion_" + c_shortName + "(\n") test_cppfile.write(" m_ctxt") - for param in params: - test_cppfile.write(", 0") + if c_shortName == 'utm': + test_cppfile.write(", 1") + else: + for param in params: + test_cppfile.write(", 0") if has_angle: test_cppfile.write(", \"Degree\", 0.0174532925199433") if has_linear: @@ -184,4 +187,4 @@ cppfile.write("/* END: Generated by scripts/create_c_api_projections.py*/\n") test_cppfile.write("/* END: Generated by scripts/create_c_api_projections.py*/\n") -print('projections.h and .cpp, and test_projections.cpp have been generated. Manually merge them now') \ No newline at end of file +print('projections.h and .cpp, and test_projections.cpp have been generated. Manually merge them now') -- cgit v1.2.3