~ubuntu-branches/ubuntu/vivid/musl/vivid

« back to all changes in this revision

Viewing changes to src/thread/pthread_cleanup_push.c

  • Committer: Package Import Robot
  • Author(s): Kevin Bortis
  • Date: 2014-05-26 22:45:52 UTC
  • mfrom: (4.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140526224552-qrtsct934q29xo0x
Tags: 1.1.4-1
* Import upstream version 1.1.4. (Closes: #754758)
* Fixes possible stack-based buffer overflow CVE-2014-3484 (Closes: #750815) 
* Includes fix for build regression on armhf and armel

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "pthread_impl.h"
 
2
 
 
3
static void dummy(struct __ptcb *cb)
 
4
{
 
5
}
 
6
weak_alias(dummy, __do_cleanup_push);
 
7
weak_alias(dummy, __do_cleanup_pop);
 
8
 
 
9
void _pthread_cleanup_push(struct __ptcb *cb, void (*f)(void *), void *x)
 
10
{
 
11
        cb->__f = f;
 
12
        cb->__x = x;
 
13
        __do_cleanup_push(cb);
 
14
}
 
15
 
 
16
void _pthread_cleanup_pop(struct __ptcb *cb, int run)
 
17
{
 
18
        __do_cleanup_pop(cb);
 
19
        if (run) cb->__f(cb->__x);
 
20
}