Skip to content

Commit

Permalink
Merge pull request #1784 from DSheirer/1783-l3h-p2-message-parse-error
Browse files Browse the repository at this point in the history
#1783 P25P2 L3Harris Talker Alias Index Out Of Bounds Exception
  • Loading branch information
DSheirer authored Jan 8, 2024
2 parents b54e94d + 1a5c752 commit 87ce08e
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit 87ce08e

Please sign in to comment.