g4klx / M17Gateway

A gateway to the M17 reflectors
GNU General Public License v2.0
16 stars 13 forks source link

Remote command fix: left trim the "Reflector" argument. #14

Closed f1rmb closed 2 years ago

f1rmb commented 2 years ago

The argument is picked at buffer+9U, then forced fitted in CALLSIGN_LENGTH, hence reflector and module are invalid. e.g:

g4klx commented 2 years ago

Surely the easy fix is to start the reflector at buffer + 10U? Much simpler.

Sent from Yahoo Mail for iPhone

On Thursday, January 20, 2022, 07:54, Daniel Caujolle-Bert @.***> wrote:

The argument is picked at buffer+9U, then forced fitted in CALLSIGN_LENGTH, hence reflector and module are invalid. e.g:

You can view, comment on, or merge this pull request online at:

  https://github.com/g4klx/M17Gateway/pull/14

Commit Summary

File Changes

(1 file)

Patch Links:

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

f1rmb commented 2 years ago

Well, the previous "no-space" between command and argument problem was in few gateways (like YSF, P25, NXDN), and the PiStar is calling the RemoteCommand software in this way. MMDVMHost expect spaces between arguments (which is fine, and human friendly). So trimming the argument, like in the other GWs now, don't break anything, and make it still compatible with unspaced old way too.

EDIT: hence, all GWs are, code wise, identical.

g4klx commented 2 years ago

It needs fixing for all of them then. It’s a bug anyway. Pi-Star can adapt.

Sent from Yahoo Mail for iPhone

On Thursday, January 20, 2022, 09:50, Daniel Caujolle-Bert @.***> wrote:

Well, the previous "no-space" between command and argument problem was in few gateways (like YSF, P25, NXDN), and the PiStar is calling the RemoteCommand software in this way. MMDVMHost expect spaces between arguments (which is fine, and human friendly). So trimming the argument, like in the other GWs now, don't break anything, and make it still compatible with unspaced old way too.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

f1rmb commented 2 years ago

Yes, PiStar can. Well, I will raise PRs for this, but it's not possible to jump at buffer +10 without length checking, as you can jump over the NULL terminator (and "RemoteCommand Reflector" simply disconnects).

f1rmb commented 2 years ago

More on the next PR.