aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-08-10 10:00:41 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-08-10 10:04:50 +0200
commit1e6ef36db92406f96fe9cc3fa7f75db1cba7254b (patch)
tree494587cc6f8a08a26fe32152df3ff64e64350469 /scripts
parente41092a9392ef76967e2c45f5c015cb6e5353b64 (diff)
downloadPROJ-1e6ef36db92406f96fe9cc3fa7f75db1cba7254b.tar.gz
PROJ-1e6ef36db92406f96fe9cc3fa7f75db1cba7254b.zip
Conversion::createUTM(): avoid integer overflow. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=36751
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/create_c_api_projections.py9
1 files changed, 6 insertions, 3 deletions
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')