vfs: check userland buffers before reading them.
[haiku.git] / src / libs / libunwind / mi / _ReadULEB.c
blob116f3e19bc9503a4ac9e4f1faad7752f39838d86
1 #include <libunwind.h>
3 unw_word_t
4 _ReadULEB (unsigned char **dpp)
6 unsigned shift = 0;
7 unw_word_t byte, result = 0;
8 unsigned char *bp = *dpp;
10 while (1)
12 byte = *bp++;
13 result |= (byte & 0x7f) << shift;
14 if ((byte & 0x80) == 0)
15 break;
16 shift += 7;
18 *dpp = bp;
19 return result;