/*
*/
/*
*
*
* Software.
*
*/
asprintf(p,const fmt,args...) : printf(fmt,args), noescape {
if (result >= 0) {
*p == new(result);
}
}
vasprintf(p,const fmt,va) : noescape {
if (result >= 0) {
*p == new(result);
}
}
}
}
message="Null pointer dereference in call to ", callee_name(), ". Pointer ", name(ptr), " may be dereferenced";
}
/*************************************************************************
*/
/** libX11 **/
}
}
}
}
"null-pointer-deref-call-X"(p) : p != 0;
}
}
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
/* Todo: XGetSelectionOwner */
"null-pointer-deref-call-X"(d) : d != 0;
result != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(e) : e != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(s) : s != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(v) : v != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(s) : s != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
"null-pointer-deref-call-X"(c) : c != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
"null-pointer-deref-call-X"(c) : c != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
"null-pointer-deref-call-X"(h) : h != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
"null-pointer-deref-call-X"(h) : h != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
min >= 8;
max <= 255;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
}
/* Todo: XFreeColors */
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
/* Todo: XFreeFontInfo */
"null-pointer-deref-call-X"(d) : d != 0;
}
"null-pointer-deref-call-X"(d) : d != 0;
}
/* Todo: XGeometry...XGetGeometry */
"null-pointer-deref-call-X"(d) : d != 0;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
op >= 128;
op <= 255;
}
}
"null-pointer-deref-call-X"(d) : d != 0;
"null-pointer-deref-call-X"(c) : c != 0;
}
}
/** libXt
* instead of return NULL
*/
XtAsprintf(p,const fmt,args...) : printf(fmt,args), noescape {
*p == new(result);
}
XtMalloc(s) {
result == new(s);
}
XtRealloc(p,s) {
delete(p);
result == new(s);
}
XtCalloc(n,s) {
result == new(n*s);
}
XtFree(p) : free(p);
/*************************************************************************
* Server side functions
*/
/* XXX - does not work! */
bugtype "wrong-size-swap"(ptr,funcsize) {
name="Wrong size Xserver swap function used";
priority="error";
enabled="true";
message="Wrong size swap function used: ", callee_name(), " expects ", funcsize, "-byte variable, got ", size(ptr),"-byte ", name(ptr), " instead.";
}
swap_uint32(x) : noescape {
"wrong-size-swap"(x,4): size(*x) == 4;
}
swap_uint16(x) : noescape {
"wrong-size-swap"(x,2): size(*x) == 4;
}
SwapLongs(x,count) : noescape {
"wrong-size-swap"(x,4): size(x) == 4;
}
SwapShorts(x,count) : noescape {
"wrong-size-swap"(x,2): size(x) == 4;
}
AllocatePixmap(const pScreen, pixDataSize) : noescape {
if (result != 0) {
result == new(pixDataSize);
}
}
FreePixmap(p) : free(p);
RegionCreate(const rect, s) {
result == new(12); /* sizeof struct pixman_region16 */
}
RegionDestroy(p) : free(p);
/* fb/fbpixmap.c */
fbCreatePixmapBpp(const pS, w, h, d, b, ht) {
if (result != 0) {
result == new(w*h);
}
}
fbCreatePixmap(const pS, w, h, d, ht) : fbCreatePixmapBpp(pS, w, h, d, d, ht);
fbDestroyPixmap(p) : FreePixmap(p);
LogWrite(verb, const fmt, args...) : printf(fmt, args), noescape;
LogMessageVerb(type, verb, const fmt, args...) : printf(fmt, args), noescape;
LogMessage(type, const fmt, args...) : printf(fmt, args), noescape;
FatalError(const fmt, args...) : printf(fmt, args), noescape, exit;
ErrorF(const fmt, args...) : printf(fmt, args), noescape;
AbortServer(): exit;
Xalloc(s) : malloc(s);
XNFalloc(s) {
result == new(s);
}
Xcalloc(s) : calloc(1,s);
XNFcalloc(s) : XNFalloc(s);
Xrealloc(p, s) : realloc(p, s);
XNFrealloc(p, s) : realloc(p, s);
Xfree(p) : free(p);
Xstrdup(const s) : noescape {
if ( s == 0 ) {
result == 0;
} else {
if( result != 0 ) {
result == new(strlen(s)+1);
strlen(result) == strlen(s);
}
}
}
XNFstrdup(const s) : noescape {
if ( s == 0 ) {
result == 0;
} else {
result == new(strlen(s)+1);
strlen(result) == strlen(s);
}
}
OsAbort() : abort();
Fopen(f, m) : fopen(f, m);
Fclose(p) : fclose(p);
Xvasprintf(p, fmt, va) : vasprintf(p, fmt, va);
Xasprintf(p, fmt, args...) : asprintf(p, fmt, args);
XNFvasprintf(p, fmt, va) : noescape {
*p == new(result);
}
XNFasprintf(p, fmt, args...) : noescape, printf(fmt, args) {
*p == new(result);
}
Xvprintf(fmt, va) : noescape {
if (result != 0) {
result == new(undefined);
}
}
Xprintf(fmt, args...) : noescape, printf(fmt, args) {
if (result != 0) {
result == new(undefined);
}
}
XNFvprintf(fmt, va) : noescape {
result == new(undefined);
}
XNFprintf(fmt, args...) : noescape, printf(fmt, args) {
result == new(undefined);
}