Skip to content

Commit

Permalink
disable TFN marker in optimized header due to security risk and low b…
Browse files Browse the repository at this point in the history
…enefit
  • Loading branch information
fangq committed Feb 24, 2022
1 parent 6345859 commit aa3913e
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions loadbj.m
Expand Up @@ -201,18 +201,14 @@
data=cell(1,count);
adv=pos;
for i=1:count
[data{i}, pos] = parse_value(inputstr, pos, type, varargin{:});
[data{i}, pos] = parse_value(inputstr, pos, type, varargin{:});
end
adv=pos-adv;
case 'C'
data=inputstr(pos:pos+count);
adv=count;
case 'T'
data=true(1,count);
case 'F'
data=false(1,count);
case 'N'
data=cell(1,count);
case {'T','F','N'}
error_pos(sprintf('For security reasons, optimized type %c is disabled at position %%d', type),inputstr, pos);
otherwise
error_pos(sprintf('Unsupported optimized type %c at position %%d', type),inputstr, pos);
end
Expand All @@ -221,7 +217,6 @@
[cid,len]=elem_info(inputstr, pos, type);
datastr=inputstr(pos:pos+len*count-1);
newdata=uint8(datastr);
%id=strfind('iUIulmLMhdD',type);
if(varargin{1}.flipendian_)
newdata=swapbytes(typecast(newdata,cid));
end
Expand Down

0 comments on commit aa3913e

Please sign in to comment.