File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 22// Licensed under the MIT license.
33
44using System ;
5- using System . Collections . Generic ;
65using Garnet . common ;
76using Microsoft . Extensions . Logging ;
8- using Tsavorite . core ;
97
108namespace Garnet . server
119{
@@ -28,6 +26,11 @@ private unsafe bool TryEVALSHA()
2826 return AbortWithWrongNumberOfArguments ( "EVALSHA" ) ;
2927 }
3028
29+ if ( ! parseState . TryGetInt ( 1 , out var n ) || ( n < 0 ) || ( n > count - 2 ) )
30+ {
31+ return AbortWithErrorMessage ( CmdStrings . RESP_ERR_GENERIC_VALUE_IS_NOT_INTEGER ) ;
32+ }
33+
3134 ref var digest = ref parseState . GetArgSliceByRef ( 0 ) ;
3235
3336 var convertedToLower = false ;
@@ -99,6 +102,11 @@ private unsafe bool TryEVAL()
99102 return AbortWithWrongNumberOfArguments ( "EVAL" ) ;
100103 }
101104
105+ if ( ! parseState . TryGetInt ( 1 , out var n ) || ( n < 0 ) || ( n > count - 2 ) )
106+ {
107+ return AbortWithErrorMessage ( CmdStrings . RESP_ERR_GENERIC_VALUE_IS_NOT_INTEGER ) ;
108+ }
109+
102110 ref var script = ref parseState . GetArgSliceByRef ( 0 ) ;
103111
104112 // that this is stack allocated is load bearing - if it moves, things will break
@@ -162,7 +170,7 @@ private bool NetworkScriptExists()
162170 exists = storeWrapper . storeScriptCache . ContainsKey ( sha1Arg ) ? 1 : 0 ;
163171 }
164172
165- while ( ! RespWriteUtils . TryWriteArrayItem ( exists , ref dcurr , dend ) )
173+ while ( ! RespWriteUtils . TryWriteInt32 ( exists , ref dcurr , dend ) )
166174 SendAndReset ( ) ;
167175 }
168176
You can’t perform that action at this time.
0 commit comments