dcerpc: move drep alloc on stack

DCERPC's drep field is always 4 bytes for connection oriented PDU types.
Make it a byte array of exactly 4 bytes to store the entire header on
stack.
pull/15914/head
Shivani Bhardwaj 3 months ago
parent 425bc4cf45
commit cbd4e6eb08

@ -278,13 +278,13 @@ pub struct Uuid {
pub node: Vec<u8>,
}
#[derive(Debug)]
#[derive(Debug, Clone, Copy)]
pub struct DCERPCHdr {
pub rpc_vers: u8,
pub rpc_vers_minor: u8,
pub hdrtype: u8,
pub pfc_flags: u8,
pub packed_drep: Vec<u8>,
pub packed_drep: [u8; 4],
pub frag_length: u16,
pub auth_length: u16,
pub call_id: u32,

@ -233,7 +233,12 @@ pub(super) fn parse_dcerpc_header(i: &[u8]) -> IResult<&[u8], DCERPCHdr> {
rpc_vers_minor,
hdrtype,
pfc_flags,
packed_drep: packed_drep.to_vec(),
packed_drep: [
packed_drep[0],
packed_drep[1],
packed_drep[2],
packed_drep[3],
],
frag_length,
auth_length,
call_id,

Loading…
Cancel
Save