From 1a5c7521a52a0b02dcdc3c8e7eaa6357150016df Mon Sep 17 00:00:00 2001 From: Dennis Sheirer Date: Mon, 8 Jan 2024 03:56:10 -0500 Subject: [PATCH] #1783 P25P2 L3Harris Talker Alias - resolves issue with trying to parse too many bits. --- .../mac/structure/l3harris/L3HarrisTalkerAlias.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/dsheirer/module/decode/p25/phase2/message/mac/structure/l3harris/L3HarrisTalkerAlias.java b/src/main/java/io/github/dsheirer/module/decode/p25/phase2/message/mac/structure/l3harris/L3HarrisTalkerAlias.java index 950521a6c..09bb4eb51 100644 --- a/src/main/java/io/github/dsheirer/module/decode/p25/phase2/message/mac/structure/l3harris/L3HarrisTalkerAlias.java +++ b/src/main/java/io/github/dsheirer/module/decode/p25/phase2/message/mac/structure/l3harris/L3HarrisTalkerAlias.java @@ -1,6 +1,6 @@ /* * ***************************************************************************** - * Copyright (C) 2014-2023 Dennis Sheirer + * Copyright (C) 2014-2024 Dennis Sheirer * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -78,8 +78,14 @@ public P25TalkerAliasIdentifier getAlias() { if(mAliasIdentifier == null) { - int length = getLength() * 8; - String alias = new String(getMessage().getSubMessage(ALIAS_START + getOffset(), length + getOffset()).getBytes()).trim(); + int length = getLength() * 8 + getOffset(); + + if(length > getMessage().size()) + { + length = getMessage().size(); + } + + String alias = new String(getMessage().getSubMessage(ALIAS_START + getOffset(), length).getBytes()).trim(); mAliasIdentifier = P25TalkerAliasIdentifier.create(alias); }