Skip to content

Commit

Permalink
raise UserWarning in .component.version has length > 1024
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <paul.horton@owasp.org>
  • Loading branch information
madpah committed Apr 8, 2024
1 parent 1327558 commit abebd4f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cyclonedx/model/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,8 @@ def version(self) -> Optional[str]:

@version.setter
def version(self, version: Optional[str]) -> None:
if version and len(version) > 1024:
warn('`.component.version`has a maximum length of 1024 from CycloneDX v1.6 onwards.', UserWarning)
self._version = version

@property
Expand Down

0 comments on commit abebd4f

Please sign in to comment.