mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
Add error handling to parser.
This commit is contained in:
@@ -122,6 +122,8 @@ Guacamole.Parser = function() {
|
||||
element_buffer.length = 0;
|
||||
|
||||
}
|
||||
else if (terminator != ',')
|
||||
throw new Error("Illegal terminator.");
|
||||
|
||||
// Start searching for length at character after
|
||||
// element terminator
|
||||
@@ -135,6 +137,8 @@ Guacamole.Parser = function() {
|
||||
|
||||
// Parse length
|
||||
var length = parseInt(buffer.substring(element_end+1, length_end));
|
||||
if (length == NaN)
|
||||
throw new Error("Non-numeric character in element length.");
|
||||
|
||||
// Calculate start of element
|
||||
start_index = length_end + 1;
|
||||
|
Reference in New Issue
Block a user