Skip to content

Commit 24cb8f9

Browse files
committed
Fix range IndexError when processing the radas signing json
1 parent 60d962c commit 24cb8f9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

charon/pkgs/radas_sign.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,13 @@ async def generate_single_sign_file(
321321
if not file_path or not signature:
322322
logger.error("Invalid JSON entry")
323323
return
324-
# remove the root path maven-repository
325-
filename = file_path.split("/", 1)[1]
326324

325+
parts = file_path.split("/", 1)
326+
if len(parts) < 2:
327+
logger.warning("Invalid entry: %s, skip signature file generation.", file_path)
328+
return
329+
# remove the root path maven-repository, valid file_path looks like: maven-repository/...
330+
filename = parts[1]
327331
artifact_path = os.path.join(top_level, filename)
328332
asc_filename = f"{filename}.asc"
329333
signature_path = os.path.join(top_level, asc_filename)

0 commit comments

Comments
 (0)