mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +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 = ' ';
|
marker = ' ';
|
||||||
cnt = attr[off+1] & 255;
|
cnt = attr[off+1] & 255;
|
||||||
auth = get6h(attr,off+2);
|
auth = get6h(attr,off+2);
|
||||||
first = get4l(attr,off+8);
|
|
||||||
known = FALSE;
|
known = FALSE;
|
||||||
if ((attr[off] == 1) /* revision */
|
if ((attr[off] == 1) /* revision */
|
||||||
&& (auth < 100))
|
&& cnt
|
||||||
|
&& (auth < 100)) {
|
||||||
|
first = get4l(attr,off+8);
|
||||||
switch (cnt) {
|
switch (cnt) {
|
||||||
case 0 : /* no level (error) */
|
case 0 : /* no level (error) */
|
||||||
break;
|
break;
|
||||||
@ -1105,6 +1106,7 @@ static void showsid(const char *attr, int off, const char *prefix, int level)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!known)
|
if (!known)
|
||||||
printf("%*cUnknown SID\n",-level,marker);
|
printf("%*cUnknown SID\n",-level,marker);
|
||||||
printf("%*c%shex S-%d-",-level,marker,prefix,attr[off] & 255);
|
printf("%*c%shex S-%d-",-level,marker,prefix,attr[off] & 255);
|
||||||
|
Loading…
Reference in New Issue
Block a user