pmap: use correct types for memory allocation

Fixes error which did not happen always.  Changes of being affected by
the bug where greater the more there where pids defined as pmap argument.
The debian bug referral can almost certainly reproduce the problem,
especially when tried multiple times in row.

pmap: malloc.c:3096: sYSMALLOc: Assertion `(old_top == (((mbinptr)
(((char *) &((av)->bins[((1) - 1) * 2])) - __builtin_offsetof (struct
malloc_chunk, fd)))) && old_size == 0) || ((unsigned long) (old_size) >=
(unsigned long)((((__builtin_offsetof (struct malloc_chunk,
fd_nextsize))+((2 * (sizeof(size_t))) - 1)) & ~((2 * (sizeof(size_t))) -
1))) && ((old_top)->size & 0x1) && ((unsigned long)old_end & pagemask) ==
0)' failed.

Reported-by: lee <lee@yun.yagibdah.de>
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=688180
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
Sami Kerola
2012-11-02 17:50:50 +00:00
committed by Craig Small
parent ee03bb92cb
commit c043c47ddd
3 changed files with 4 additions and 4 deletions

2
pmap.c
View File

@@ -661,7 +661,7 @@ int main(int argc, char **argv)
x_option && (d_option || X_option))
xerrx(EXIT_FAILURE, _("options -d, -x, -X are mutually exclusive"));
pidlist = xmalloc(sizeof(unsigned) * argc);
pidlist = xmalloc(sizeof(unsigned long) * argc);
while (*argv) {
char *walk = *argv++;