mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-08 22:38:01 -06:00
Fix core dump bug in tree path search
This commit is contained in:
+4
-3
@@ -1,11 +1,12 @@
|
||||
use alloc::{boxed::Box, string::String, vec::Vec};
|
||||
|
||||
use crate::tree::request::{TreeRequest, TreeRequestType};
|
||||
|
||||
mod request;
|
||||
|
||||
pub use request::{TreeRequest, TreeRequestType};
|
||||
|
||||
pub mod types;
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct Tree {
|
||||
endpoints: Vec<(Box<dyn Endpoint>, Vec<String>)>,
|
||||
}
|
||||
@@ -24,7 +25,7 @@ impl Tree {
|
||||
return None;
|
||||
}
|
||||
|
||||
for i in 0..search_path.len() {
|
||||
for i in 0..endpoint_path.len() {
|
||||
if search_path[i] != endpoint_path[i] {
|
||||
return None;
|
||||
}
|
||||
|
||||
+4
-5
@@ -25,14 +25,13 @@ pub struct TreeRequest {
|
||||
#[rkyv(compare(PartialEq), derive(Debug))]
|
||||
pub enum TreeRequestType {
|
||||
Return = 0,
|
||||
|
||||
Read = 1,
|
||||
Write = 2,
|
||||
Submit = 3,
|
||||
GetProcedures = 2,
|
||||
|
||||
ListBranches = 10,
|
||||
Write = 11,
|
||||
CallProcedure = 12,
|
||||
|
||||
// CreateField = 3,
|
||||
// DeleteField = 4,
|
||||
UnnamedError = 100,
|
||||
NoBranchError = 101,
|
||||
ProtocolError = 102,
|
||||
|
||||
@@ -1,3 +1,16 @@
|
||||
use alloc::{string::String, vec::Vec};
|
||||
|
||||
use crate::obfuscate::sym;
|
||||
|
||||
pub const TYPE_NONE: &'static str = sym!("core/None");
|
||||
|
||||
pub const TYPE_PROCEDURE_CALL_DESCRIPTOR: &'static str = sym!("core/Procedure_call_descriptor");
|
||||
pub struct ProcedureCallDescriptor {
|
||||
name: String,
|
||||
}
|
||||
|
||||
pub const TYPE_PROCEDURE_CALL_DESCRIPTOR_LIST: &'static str =
|
||||
sym!("core/Procedure_call_descriptor_list");
|
||||
pub type ProcedureCallDescriptorList = Vec<ProcedureCallDescriptor>;
|
||||
|
||||
pub const TYPE_PROCEDURE_CALL_ARGUMENTS: &'static str = sym!("core/Procedure_call_arguments");
|
||||
|
||||
Reference in New Issue
Block a user