mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-15 01:57:39 -05:00
#1783 L3H Talker Alias guard against negative length aliases
This commit is contained in:
@@ -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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -28,4 +28,4 @@
|
|||||||
# tag name, specifically the dashes inserted before and after the alpha/beta labels.
|
# tag name, specifically the dashes inserted before and after the alpha/beta labels.
|
||||||
# See: https://github.com/DSheirer/sdrtrunk/issues/1651
|
# See: https://github.com/DSheirer/sdrtrunk/issues/1651
|
||||||
|
|
||||||
projectVersion=0.6.0
|
projectVersion=0.7.0-alpha-1
|
||||||
@@ -78,15 +78,21 @@ public class L3HarrisTalkerAlias extends MacStructure
|
|||||||
{
|
{
|
||||||
if(mAliasIdentifier == null)
|
if(mAliasIdentifier == null)
|
||||||
{
|
{
|
||||||
int length = getLength() * 8 + getOffset();
|
int length = getLength();
|
||||||
|
|
||||||
if(length > getMessage().size())
|
if(length > 0)
|
||||||
{
|
{
|
||||||
length = getMessage().size();
|
length *= 8;
|
||||||
}
|
length += getOffset();
|
||||||
|
|
||||||
String alias = new String(getMessage().getSubMessage(ALIAS_START + getOffset(), length).getBytes()).trim();
|
if(length > getMessage().size())
|
||||||
mAliasIdentifier = P25TalkerAliasIdentifier.create(alias);
|
{
|
||||||
|
length = getMessage().size();
|
||||||
|
}
|
||||||
|
|
||||||
|
String alias = new String(getMessage().getSubMessage(ALIAS_START + getOffset(), length).getBytes()).trim();
|
||||||
|
mAliasIdentifier = P25TalkerAliasIdentifier.create(alias);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return mAliasIdentifier;
|
return mAliasIdentifier;
|
||||||
|
|||||||
Reference in New Issue
Block a user