Commit 14ff4c9
gh-120155: Fix Coverity issue in zoneinfo load_data() (GH-120232)
Declare the 'rv' varaible at the top of the load_data() function to
make sure that it's initialized before the first 'goto error' which
uses 'rv' (return rv).
Fix the Coverity issue:
Error: UNINIT (CWE-457):
Python-3.12.2/Modules/_zoneinfo.c:1233:5: skipped_decl: Jumping over declaration of ""rv"".
Python-3.12.2/Modules/_zoneinfo.c:1284:5: uninit_use: Using uninitialized value ""rv"".
1282| }
1283|
1284|-> return rv;
1285| }
1286|
(cherry picked from commit b90bd3e)
Co-authored-by: Victor Stinner <[email protected]>
1 parent 03cd447 commit 14ff4c9
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
| 947 | + | |
947 | 948 | | |
948 | 949 | | |
949 | 950 | | |
| |||
1220 | 1221 | | |
1221 | 1222 | | |
1222 | 1223 | | |
1223 | | - | |
1224 | 1224 | | |
1225 | 1225 | | |
1226 | 1226 | | |
| |||
0 commit comments