mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
Checked the number of subauthorities before accessing them
Be more crash resistent when analyzing a badly formed SID. (contributed by Ulf Zibis)
This commit is contained in:
parent
d587ff54f9
commit
1b8b599408
@ -971,10 +971,11 @@ static void showsid(const char *attr, int off, const char *prefix, int level)
|
||||
marker = ' ';
|
||||
cnt = attr[off+1] & 255;
|
||||
auth = get6h(attr,off+2);
|
||||
first = get4l(attr,off+8);
|
||||
known = FALSE;
|
||||
if ((attr[off] == 1) /* revision */
|
||||
&& (auth < 100))
|
||||
&& cnt
|
||||
&& (auth < 100)) {
|
||||
first = get4l(attr,off+8);
|
||||
switch (cnt) {
|
||||
case 0 : /* no level (error) */
|
||||
break;
|
||||
@ -1105,6 +1106,7 @@ static void showsid(const char *attr, int off, const char *prefix, int level)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!known)
|
||||
printf("%*cUnknown SID\n",-level,marker);
|
||||
printf("%*c%shex S-%d-",-level,marker,prefix,attr[off] & 255);
|
||||
|
Loading…
Reference in New Issue
Block a user