Commit bf64a6b
fix: remove redundant variable initialization flagged by CodeQL
Removed dead store of rc variable in mgr_snapshot_cmd(). The variable
was initialized to SnapshotStatus.SNAPSHOT_OK but immediately overwritten
by verify_snapset_source_lvs_exist() before ever being used.
In the check_mode path, explicitly use SnapshotStatus.SNAPSHOT_OK instead
of the rc variable for clarity, since we know rc must be SNAPSHOT_OK at
that point (or we would have returned early on line 213-214).
This fixes CodeQL alert py/multiple-definition:
'This assignment to rc is unnecessary as it is redefined before this
value is used.'
Addresses: https://github.com/linux-system-roles/snapshot/security/code-scanning/95
Signed-off-by: Todd Gill <tgill@redhat.com>1 parent e25e068 commit bf64a6b
1 file changed
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
| |||
242 | 241 | | |
243 | 242 | | |
244 | 243 | | |
245 | | - | |
| 244 | + | |
246 | 245 | | |
247 | 246 | | |
248 | 247 | | |
| |||
0 commit comments