Skip to content

Commit

Permalink
update_crosspoints argument saftey
Browse files Browse the repository at this point in the history
  • Loading branch information
phillipivan committed Jul 9, 2024
1 parent cd9f96d commit c61afed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/crosspoints.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,17 @@ export function SetCrosspoint(sourceN, destN, levelN) {
this.log('debug', 'Crosspoint ' + sourceN + '>' + destN + ' level ' + levelN)
console.log('SetCrosspoint ' + sourceN + '>' + destN + ' level ' + levelN)

if (sourceN <= 0 || sourceN > 65536) {
if (isNaN(sourceN) || sourceN <= 0 || sourceN > 65536) {
this.log('warn', 'Unable to route source ' + sourceN)
return
}

if (destN <= 0 || destN > 65536) {
if (isNaN(destN) || destN <= 0 || destN > 65536) {
this.log('warn', 'Unable to route destination ' + destN)
return
}

if (levelN <= 0 || levelN > 256) {
if (isNaN(levelN) || levelN <= 0 || levelN > 256) {
this.log('warn', 'Unable to route level ' + levelN)
return
}
Expand Down

0 comments on commit c61afed

Please sign in to comment.