Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1783 L3H P25P2 Talker Alias Guard Against Negative Length Aliases #1786

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions gradle.properties
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 @@ -28,4 +28,4 @@
# tag name, specifically the dashes inserted before and after the alpha/beta labels.
# See: https://github.com/DSheirer/sdrtrunk/issues/1651

projectVersion=0.6.0
projectVersion=0.7.0-alpha-1
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,21 @@ public P25TalkerAliasIdentifier getAlias()
{
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();

if(length > getMessage().size())
{
length = getMessage().size();
}

String alias = new String(getMessage().getSubMessage(ALIAS_START + getOffset(), length).getBytes()).trim();
mAliasIdentifier = P25TalkerAliasIdentifier.create(alias);
String alias = new String(getMessage().getSubMessage(ALIAS_START + getOffset(), length).getBytes()).trim();
mAliasIdentifier = P25TalkerAliasIdentifier.create(alias);
}
}

return mAliasIdentifier;
Expand Down