idx
int64
func_before
string
Vulnerability Classification
string
vul
int64
func_after
string
patch
string
CWE ID
string
lines_before
string
lines_after
string
1,000
SplashPath *Splash::makeStrokePath(SplashPath *path, GBool flatten) { SplashPath *pathIn, *pathOut; SplashCoord w, d, dx, dy, wdx, wdy, dxNext, dyNext, wdxNext, wdyNext; SplashCoord crossprod, dotprod, miter, m; GBool first, last, closed; int subpathStart, next, i; int left0, left1, left2, right0, right1, r...
DoS Exec Code Overflow
0
SplashPath *Splash::makeStrokePath(SplashPath *path, GBool flatten) { SplashPath *pathIn, *pathOut; SplashCoord w, d, dx, dy, wdx, wdy, dxNext, dyNext, wdxNext, wdyNext; SplashCoord crossprod, dotprod, miter, m; GBool first, last, closed; int subpathStart, next, i; int left0, left1, left2, right0, right1, r...
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,001
inline void Splash::pipeIncX(SplashPipe *pipe) { ++pipe->x; if (state->softMask) { ++pipe->softMaskPtr; } switch (bitmap->mode) { case splashModeMono1: if (!(pipe->destColorMask >>= 1)) { pipe->destColorMask = 0x80; ++pipe->destColorPtr; } break; case splashModeMono8: ++pipe-...
DoS Exec Code Overflow
0
inline void Splash::pipeIncX(SplashPipe *pipe) { ++pipe->x; if (state->softMask) { ++pipe->softMaskPtr; } switch (bitmap->mode) { case splashModeMono1: if (!(pipe->destColorMask >>= 1)) { pipe->destColorMask = 0x80; ++pipe->destColorPtr; } break; case splashModeMono8: ++pipe-...
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,002
inline void Splash::pipeInit(SplashPipe *pipe, int x, int y, SplashPattern *pattern, SplashColorPtr cSrc, SplashCoord aInput, GBool usesShape, GBool nonIsolatedGroup) { pipeSetXY(pipe, x, y); pipe->pattern = NULL; if (pattern) { if (pattern->isStatic()) { pattern->getColor(x, y,...
DoS Exec Code Overflow
0
inline void Splash::pipeInit(SplashPipe *pipe, int x, int y, SplashPattern *pattern, SplashColorPtr cSrc, SplashCoord aInput, GBool usesShape, GBool nonIsolatedGroup) { pipeSetXY(pipe, x, y); pipe->pattern = NULL; if (pattern) { if (pattern->isStatic()) { pattern->getColor(x, y,...
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,003
inline void Splash::pipeRun(SplashPipe *pipe) { Guchar aSrc, aDest, alpha2, alpha0, aResult; SplashColor cDest, cBlend; Guchar cResult0, cResult1, cResult2, cResult3; if (pipe->pattern) { pipe->pattern->getColor(pipe->x, pipe->y, pipe->cSrcVal); } if (pipe->noTransparency && !state->blendFunc) { ...
DoS Exec Code Overflow
0
inline void Splash::pipeRun(SplashPipe *pipe) { Guchar aSrc, aDest, alpha2, alpha0, aResult; SplashColor cDest, cBlend; Guchar cResult0, cResult1, cResult2, cResult3; if (pipe->pattern) { pipe->pattern->getColor(pipe->x, pipe->y, pipe->cSrcVal); } if (pipe->noTransparency && !state->blendFunc) { ...
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,004
inline void Splash::pipeSetXY(SplashPipe *pipe, int x, int y) { pipe->x = x; pipe->y = y; if (state->softMask) { pipe->softMaskPtr = &state->softMask->data[y * state->softMask->rowSize + x]; } switch (bitmap->mode) { case splashModeMono1: pipe->destColorPtr = &bitmap->data[y * bitmap->rowSiz...
DoS Exec Code Overflow
0
inline void Splash::pipeSetXY(SplashPipe *pipe, int x, int y) { pipe->x = x; pipe->y = y; if (state->softMask) { pipe->softMaskPtr = &state->softMask->data[y * state->softMask->rowSize + x]; } switch (bitmap->mode) { case splashModeMono1: pipe->destColorPtr = &bitmap->data[y * bitmap->rowSiz...
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,005
SplashError Splash::restoreState() { SplashState *oldState; if (!state->next) { return splashErrNoSave; } oldState = state; state = state->next; delete oldState; return splashOk; }
DoS Exec Code Overflow
0
SplashError Splash::restoreState() { SplashState *oldState; if (!state->next) { return splashErrNoSave; } oldState = state; state = state->next; delete oldState; return splashOk; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,006
void Splash::saveState() { SplashState *newState; newState = state->copy(); newState->next = state; state = newState; }
DoS Exec Code Overflow
0
void Splash::saveState() { SplashState *newState; newState = state->copy(); newState->next = state; state = newState; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,007
void Splash::setBlendFunc(SplashBlendFunc func) { state->blendFunc = func; }
DoS Exec Code Overflow
0
void Splash::setBlendFunc(SplashBlendFunc func) { state->blendFunc = func; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,008
void Splash::setFlatness(SplashCoord flatness) { if (flatness < 1) { state->flatness = 1; } else { state->flatness = flatness; } }
DoS Exec Code Overflow
0
void Splash::setFlatness(SplashCoord flatness) { if (flatness < 1) { state->flatness = 1; } else { state->flatness = flatness; } }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,009
void Splash::setInNonIsolatedGroup(SplashBitmap *alpha0BitmapA, int alpha0XA, int alpha0YA) { alpha0Bitmap = alpha0BitmapA; alpha0X = alpha0XA; alpha0Y = alpha0YA; state->inNonIsolatedGroup = gTrue; }
DoS Exec Code Overflow
0
void Splash::setInNonIsolatedGroup(SplashBitmap *alpha0BitmapA, int alpha0XA, int alpha0YA) { alpha0Bitmap = alpha0BitmapA; alpha0X = alpha0XA; alpha0Y = alpha0YA; state->inNonIsolatedGroup = gTrue; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,010
void Splash::setLineCap(int lineCap) { state->lineCap = lineCap; }
DoS Exec Code Overflow
0
void Splash::setLineCap(int lineCap) { state->lineCap = lineCap; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,011
void Splash::setLineDash(SplashCoord *lineDash, int lineDashLength, SplashCoord lineDashPhase) { state->setLineDash(lineDash, lineDashLength, lineDashPhase); }
DoS Exec Code Overflow
0
void Splash::setLineDash(SplashCoord *lineDash, int lineDashLength, SplashCoord lineDashPhase) { state->setLineDash(lineDash, lineDashLength, lineDashPhase); }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,012
void Splash::setLineWidth(SplashCoord lineWidth) { state->lineWidth = lineWidth; }
DoS Exec Code Overflow
0
void Splash::setLineWidth(SplashCoord lineWidth) { state->lineWidth = lineWidth; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,013
void Splash::setMatrix(SplashCoord *matrix) { memcpy(state->matrix, matrix, 6 * sizeof(SplashCoord)); }
DoS Exec Code Overflow
0
void Splash::setMatrix(SplashCoord *matrix) { memcpy(state->matrix, matrix, 6 * sizeof(SplashCoord)); }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,014
void Splash::setScreen(SplashScreen *screen) { state->setScreen(screen); }
DoS Exec Code Overflow
0
void Splash::setScreen(SplashScreen *screen) { state->setScreen(screen); }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,015
void Splash::setSoftMask(SplashBitmap *softMask) { state->setSoftMask(softMask); }
DoS Exec Code Overflow
0
void Splash::setSoftMask(SplashBitmap *softMask) { state->setSoftMask(softMask); }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,016
void Splash::setStrokeAlpha(SplashCoord alpha) { state->strokeAlpha = alpha; }
DoS Exec Code Overflow
0
void Splash::setStrokeAlpha(SplashCoord alpha) { state->strokeAlpha = alpha; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,017
void Splash::setStrokePattern(SplashPattern *strokePattern) { state->setStrokePattern(strokePattern); }
DoS Exec Code Overflow
0
void Splash::setStrokePattern(SplashPattern *strokePattern) { state->setStrokePattern(strokePattern); }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,018
SplashError Splash::stroke(SplashPath *path) { SplashPath *path2, *dPath; if (debugMode) { printf("stroke [dash:%d] [width:%.2f]:\n", state->lineDashLength, (double)state->lineWidth); dumpPath(path); } opClipRes = splashClipAllOutside; if (path->length == 0) { return splashErrEmptyPath; } ...
DoS Exec Code Overflow
0
SplashError Splash::stroke(SplashPath *path) { SplashPath *path2, *dPath; if (debugMode) { printf("stroke [dash:%d] [width:%.2f]:\n", state->lineDashLength, (double)state->lineWidth); dumpPath(path); } opClipRes = splashClipAllOutside; if (path->length == 0) { return splashErrEmptyPath; } ...
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,019
void Splash::strokeWide(SplashPath *path) { SplashPath *path2; path2 = makeStrokePath(path, gFalse); fillWithPattern(path2, gFalse, state->strokePattern, state->strokeAlpha); delete path2; }
DoS Exec Code Overflow
0
void Splash::strokeWide(SplashPath *path) { SplashPath *path2; path2 = makeStrokePath(path, gFalse); fillWithPattern(path2, gFalse, state->strokePattern, state->strokeAlpha); delete path2; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,020
inline void Splash::transform(SplashCoord *matrix, SplashCoord xi, SplashCoord yi, SplashCoord *xo, SplashCoord *yo) { *xo = xi * matrix[0] + yi * matrix[2] + matrix[4]; *yo = xi * matrix[1] + yi * matrix[3] + matrix[5]; }
DoS Exec Code Overflow
0
inline void Splash::transform(SplashCoord *matrix, SplashCoord xi, SplashCoord yi, SplashCoord *xo, SplashCoord *yo) { *xo = xi * matrix[0] + yi * matrix[2] + matrix[4]; *yo = xi * matrix[1] + yi * matrix[3] + matrix[5]; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,021
inline void Splash::updateModX(int x) { if (x < modXMin) { modXMin = x; } if (x > modXMax) { modXMax = x; } }
DoS Exec Code Overflow
0
inline void Splash::updateModX(int x) { if (x < modXMin) { modXMin = x; } if (x > modXMax) { modXMax = x; } }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,022
SplashError Splash::xorFill(SplashPath *path, GBool eo) { SplashPipe pipe; SplashXPath *xPath; SplashXPathScanner *scanner; int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y; SplashClipResult clipRes, clipRes2; SplashBlendFunc origBlendFunc; if (path->length == 0) { return splashErrEmptyPath; } xPath = n...
DoS Exec Code Overflow
0
SplashError Splash::xorFill(SplashPath *path, GBool eo) { SplashPipe pipe; SplashXPath *xPath; SplashXPathScanner *scanner; int xMinI, yMinI, xMaxI, yMaxI, x0, x1, y; SplashClipResult clipRes, clipRes2; SplashBlendFunc origBlendFunc; if (path->length == 0) { return splashErrEmptyPath; } xPath = n...
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2005-2008 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2005-2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2005 Marco Pesenti Gritti <mpg@redhat.com> // //...
CWE-189
null
null
1,023
Guchar SplashBitmap::getAlpha(int x, int y) { return alpha[y * width + x]; }
DoS Exec Code Overflow
0
Guchar SplashBitmap::getAlpha(int x, int y) { return alpha[y * width + x]; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2006 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2006, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2007 Ilmari Heikkinen <ilmari.heikkinen@gmail.com> //...
CWE-189
null
null
1,024
SplashError SplashBitmap::writePNMFile(char *fileName) { FILE *f; SplashError e; if (!(f = fopen(fileName, "wb"))) { return splashErrOpenFile; } e = this->writePNMFile(f); fclose(f); return e; }
DoS Exec Code Overflow
0
SplashError SplashBitmap::writePNMFile(char *fileName) { FILE *f; SplashError e; if (!(f = fopen(fileName, "wb"))) { return splashErrOpenFile; } e = this->writePNMFile(f); fclose(f); return e; }
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2006 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2006, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2007 Ilmari Heikkinen <ilmari.heikkinen@gmail.com> //...
CWE-189
null
null
1,025
SplashError SplashBitmap::writePNMFile(FILE *f) { SplashColorPtr row, p; int x, y; switch (mode) { case splashModeMono1: fprintf(f, "P4\n%d %d\n", width, height); row = data; for (y = 0; y < height; ++y) { p = row; for (x = 0; x < width; x += 8) { fputc(*p ^ 0xff, f); ++p; } ...
DoS Exec Code Overflow
0
SplashError SplashBitmap::writePNMFile(FILE *f) { SplashColorPtr row, p; int x, y; switch (mode) { case splashModeMono1: fprintf(f, "P4\n%d %d\n", width, height); row = data; for (y = 0; y < height; ++y) { p = row; for (x = 0; x < width; x += 8) { fputc(*p ^ 0xff, f); ++p; } ...
@@ -11,7 +11,7 @@ // All changes made under the Poppler project to this file are licensed // under GPL version 2 or later // -// Copyright (C) 2006 Albert Astals Cid <aacid@kde.org> +// Copyright (C) 2006, 2009 Albert Astals Cid <aacid@kde.org> // Copyright (C) 2007 Ilmari Heikkinen <ilmari.heikkinen@gmail.com> //...
CWE-189
null
null
1,026
GBool SplashFTFont::getGlyph(int c, int xFrac, int yFrac, SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) { return SplashFont::getGlyph(c, xFrac, 0, bitmap, x0, y0, clip, clipRes); }
DoS Exec Code Overflow
0
GBool SplashFTFont::getGlyph(int c, int xFrac, int yFrac, SplashGlyphBitmap *bitmap, int x0, int y0, SplashClip *clip, SplashClipResult *clipRes) { return SplashFont::getGlyph(c, xFrac, 0, bitmap, x0, y0, clip, clipRes); }
@@ -243,7 +243,7 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac, } else { rowSize = (bitmap->w + 7) >> 3; } - bitmap->data = (Guchar *)gmalloc(rowSize * bitmap->h); + bitmap->data = (Guchar *)gmallocn(rowSize, bitmap->h); bitmap->freeData = gTrue; for (i = 0, p = bitmap->data, q = slot-...
CWE-189
null
null
1,027
SplashPath *SplashFTFont::getGlyphPath(int c) { static FT_Outline_Funcs outlineFuncs = { #if FREETYPE_MINOR <= 1 (int (*)(FT_Vector *, void *))&glyphPathMoveTo, (int (*)(FT_Vector *, void *))&glyphPathLineTo, (int (*)(FT_Vector *, FT_Vector *, void *))&glyphPathConicTo, (int (*)(FT_Vector *, FT_Vector...
DoS Exec Code Overflow
0
SplashPath *SplashFTFont::getGlyphPath(int c) { static FT_Outline_Funcs outlineFuncs = { #if FREETYPE_MINOR <= 1 (int (*)(FT_Vector *, void *))&glyphPathMoveTo, (int (*)(FT_Vector *, void *))&glyphPathLineTo, (int (*)(FT_Vector *, FT_Vector *, void *))&glyphPathConicTo, (int (*)(FT_Vector *, FT_Vector...
@@ -243,7 +243,7 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac, } else { rowSize = (bitmap->w + 7) >> 3; } - bitmap->data = (Guchar *)gmalloc(rowSize * bitmap->h); + bitmap->data = (Guchar *)gmallocn(rowSize, bitmap->h); bitmap->freeData = gTrue; for (i = 0, p = bitmap->data, q = slot-...
CWE-189
null
null
1,028
static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt, void *path) { SplashFTFontPath *p = (SplashFTFontPath *)path; SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xc, yc; if (!p->path->getCurPt(&x0, &y0)) { return 0; } xc = (SplashCoord)ctrl->x * p->textScale / 64.0; yc = (SplashC...
DoS Exec Code Overflow
0
static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt, void *path) { SplashFTFontPath *p = (SplashFTFontPath *)path; SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xc, yc; if (!p->path->getCurPt(&x0, &y0)) { return 0; } xc = (SplashCoord)ctrl->x * p->textScale / 64.0; yc = (SplashC...
@@ -243,7 +243,7 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac, } else { rowSize = (bitmap->w + 7) >> 3; } - bitmap->data = (Guchar *)gmalloc(rowSize * bitmap->h); + bitmap->data = (Guchar *)gmallocn(rowSize, bitmap->h); bitmap->freeData = gTrue; for (i = 0, p = bitmap->data, q = slot-...
CWE-189
null
null
1,029
SplashFTFont::~SplashFTFont() { }
DoS Exec Code Overflow
0
SplashFTFont::~SplashFTFont() { }
@@ -243,7 +243,7 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac, } else { rowSize = (bitmap->w + 7) >> 3; } - bitmap->data = (Guchar *)gmalloc(rowSize * bitmap->h); + bitmap->data = (Guchar *)gmallocn(rowSize, bitmap->h); bitmap->freeData = gTrue; for (i = 0, p = bitmap->data, q = slot-...
CWE-189
null
null
1,030
void gMemReport(FILE *f) { GMemHdr *p; fprintf(f, "%d memory allocations in all\n", gMemIndex); if (gMemAlloc > 0) { fprintf(f, "%d memory blocks left allocated:\n", gMemAlloc); fprintf(f, " index size\n"); fprintf(f, "-------- --------\n"); for (p = gMemHead; p; p = p->next) { fprintf(...
DoS Exec Code Overflow
0
void gMemReport(FILE *f) { GMemHdr *p; fprintf(f, "%d memory allocations in all\n", gMemIndex); if (gMemAlloc > 0) { fprintf(f, "%d memory blocks left allocated:\n", gMemAlloc); fprintf(f, " index size\n"); fprintf(f, "-------- --------\n"); for (p = gMemHead; p; p = p->next) { fprintf(...
@@ -216,6 +216,28 @@ void *gmallocn_checkoverflow(int nObjs, int objSize) GMEM_EXCEP { return gmallocn(nObjs, objSize, true); } +inline static void *gmallocn3(int a, int b, int c, bool checkoverflow) GMEM_EXCEP { + int n = a * b; + if (b <= 0 || a < 0 || a >= INT_MAX / b) { +#if USE_EXCEPTIONS + throw GMemEx...
CWE-399
null
null
1,031
pair<const EntityDescriptor*,const RoleDescriptor*> DynamicMetadataProvider::getEntityDescriptor(const Criteria& criteria) const { Category& log = Category::getInstance(SAML_LOGCAT ".MetadataProvider.Dynamic"); bool writeLocked = false; pair<const EntityDescriptor*,const RoleDescriptor*> entity = Abstract...
null
0
pair<const EntityDescriptor*,const RoleDescriptor*> DynamicMetadataProvider::getEntityDescriptor(const Criteria& criteria) const { Category& log = Category::getInstance(SAML_LOGCAT ".MetadataProvider.Dynamic"); bool writeLocked = false; pair<const EntityDescriptor*,const RoleDescriptor*> entity = Abstract...
@@ -79,7 +79,7 @@ namespace opensaml { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : AbstractMetadataProvider(e), + : AbstractMetadataProvider(e), MetadataProvider(e), m_validate(XMLHelper::getAttrBool(e, false, validate)), m_id(XMLHelper::getAttrString(e, "Dynam...
CWE-347
null
null
1,032
const XMLObject* DynamicMetadataProvider::getMetadata() const { throw MetadataException("getMetadata operation not implemented on this provider."); }
null
0
const XMLObject* DynamicMetadataProvider::getMetadata() const { throw MetadataException("getMetadata operation not implemented on this provider."); }
@@ -79,7 +79,7 @@ namespace opensaml { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : AbstractMetadataProvider(e), + : AbstractMetadataProvider(e), MetadataProvider(e), m_validate(XMLHelper::getAttrBool(e, false, validate)), m_id(XMLHelper::getAttrString(e, "Dynam...
CWE-347
null
null
1,033
Lockable* DynamicMetadataProvider::lock() { m_lock->rdlock(); return this; }
null
0
Lockable* DynamicMetadataProvider::lock() { m_lock->rdlock(); return this; }
@@ -79,7 +79,7 @@ namespace opensaml { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : AbstractMetadataProvider(e), + : AbstractMetadataProvider(e), MetadataProvider(e), m_validate(XMLHelper::getAttrBool(e, false, validate)), m_id(XMLHelper::getAttrString(e, "Dynam...
CWE-347
null
null
1,034
EntityDescriptor* DynamicMetadataProvider::resolve(const Criteria& criteria) const { string name; if (criteria.entityID_ascii) { name = criteria.entityID_ascii; } else if (criteria.entityID_unicode) { auto_ptr_char temp(criteria.entityID_unicode); name = temp.get(); } els...
null
0
EntityDescriptor* DynamicMetadataProvider::resolve(const Criteria& criteria) const { string name; if (criteria.entityID_ascii) { name = criteria.entityID_ascii; } else if (criteria.entityID_unicode) { auto_ptr_char temp(criteria.entityID_unicode); name = temp.get(); } els...
@@ -79,7 +79,7 @@ namespace opensaml { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : AbstractMetadataProvider(e), + : AbstractMetadataProvider(e), MetadataProvider(e), m_validate(XMLHelper::getAttrBool(e, false, validate)), m_id(XMLHelper::getAttrString(e, "Dynam...
CWE-347
null
null
1,035
void DynamicMetadataProvider::unlock() { m_lock->unlock(); }
null
0
void DynamicMetadataProvider::unlock() { m_lock->unlock(); }
@@ -79,7 +79,7 @@ namespace opensaml { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : AbstractMetadataProvider(e), + : AbstractMetadataProvider(e), MetadataProvider(e), m_validate(XMLHelper::getAttrBool(e, false, validate)), m_id(XMLHelper::getAttrString(e, "Dynam...
CWE-347
null
null
1,036
DynamicMetadataProvider::~DynamicMetadataProvider() { clearDescriptorIndex(true); if (m_cleanup_thread) { m_shutdown = true; m_cleanup_wait->signal(); m_cleanup_thread->join(nullptr); delete m_cleanup_thread; delete m_cleanup_wait; m_cleanup_thread = nullptr; ...
null
0
DynamicMetadataProvider::~DynamicMetadataProvider() { clearDescriptorIndex(true); if (m_cleanup_thread) { m_shutdown = true; m_cleanup_wait->signal(); m_cleanup_thread->join(nullptr); delete m_cleanup_thread; delete m_cleanup_wait; m_cleanup_thread = nullptr; ...
@@ -79,7 +79,7 @@ namespace opensaml { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : AbstractMetadataProvider(e), + : AbstractMetadataProvider(e), MetadataProvider(e), m_validate(XMLHelper::getAttrBool(e, false, validate)), m_id(XMLHelper::getAttrString(e, "Dynam...
CWE-347
null
null
1,037
saml2md::MetadataProvider* SHIBSP_DLLLOCAL DynamicMetadataProviderFactory(const DOMElement* const & e) { return new DynamicMetadataProvider(e); }
null
0
saml2md::MetadataProvider* SHIBSP_DLLLOCAL DynamicMetadataProviderFactory(const DOMElement* const & e) { return new DynamicMetadataProvider(e); }
@@ -95,7 +95,7 @@ namespace shibsp { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : saml2md::DynamicMetadataProvider(e), + : saml2md::DynamicMetadataProvider(e), MetadataProvider(e), m_verifyHost(XMLHelper::getAttrBool(e, true, verifyHost)), m_ignoreTransport(XM...
CWE-347
null
null
1,038
saml2md::EntityDescriptor* DynamicMetadataProvider::resolve(const saml2md::MetadataProvider::Criteria& criteria) const { #ifdef _DEBUG xmltooling::NDC("resolve"); #endif Category& log=Category::getInstance(SHIBSP_LOGCAT ".MetadataProvider.Dynamic"); string name; if (criteria.entityID_ascii) { n...
null
0
saml2md::EntityDescriptor* DynamicMetadataProvider::resolve(const saml2md::MetadataProvider::Criteria& criteria) const { #ifdef _DEBUG xmltooling::NDC("resolve"); #endif Category& log=Category::getInstance(SHIBSP_LOGCAT ".MetadataProvider.Dynamic"); string name; if (criteria.entityID_ascii) { n...
@@ -95,7 +95,7 @@ namespace shibsp { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : saml2md::DynamicMetadataProvider(e), + : saml2md::DynamicMetadataProvider(e), MetadataProvider(e), m_verifyHost(XMLHelper::getAttrBool(e, true, verifyHost)), m_ignoreTransport(XM...
CWE-347
null
null
1,039
virtual ~DynamicMetadataProvider() {}
null
0
virtual ~DynamicMetadataProvider() {}
@@ -95,7 +95,7 @@ namespace shibsp { }; DynamicMetadataProvider::DynamicMetadataProvider(const DOMElement* e) - : saml2md::DynamicMetadataProvider(e), + : saml2md::DynamicMetadataProvider(e), MetadataProvider(e), m_verifyHost(XMLHelper::getAttrBool(e, true, verifyHost)), m_ignoreTransport(XM...
CWE-347
null
null
1,040
static __be32 *__xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes) { __be32 *p = xdr->p; __be32 *q = p + XDR_QUADLEN(nbytes); if (q > xdr->end || q < p) return NULL; xdr->p = q; return p; }
Overflow
0
static __be32 *__xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes) { __be32 *p = xdr->p; __be32 *q = p + XDR_QUADLEN(nbytes); if (q > xdr->end || q < p) return NULL; xdr->p = q; return p; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,041
static int decode_filename(struct xdr_stream *xdr, char *name, u32 *length) { __be32 *p; u32 count; p = xdr_inline_decode(xdr, 4); if (!p) goto out_overflow; count = ntoh32(net_read_uint32(p)); if (count > 255) goto out_nametoolong; p = xdr_inline_decode(xdr, count); if (!p) goto out_overflow; memcpy(na...
Overflow
0
static int decode_filename(struct xdr_stream *xdr, char *name, u32 *length) { __be32 *p; u32 count; p = xdr_inline_decode(xdr, 4); if (!p) goto out_overflow; count = ntoh32(net_read_uint32(p)); if (count > 255) goto out_nametoolong; p = xdr_inline_decode(xdr, count); if (!p) goto out_overflow; memcpy(na...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,042
static uint32_t *nfs_add_fh3(uint32_t *p, struct nfs_fh *fh) { *p++ = hton32(fh->size); /* zero padding */ if (fh->size & 3) p[fh->size / 4] = 0; memcpy(p, fh->data, fh->size); p += DIV_ROUND_UP(fh->size, 4); return p; }
Overflow
0
static uint32_t *nfs_add_fh3(uint32_t *p, struct nfs_fh *fh) { *p++ = hton32(fh->size); /* zero padding */ if (fh->size & 3) p[fh->size / 4] = 0; memcpy(p, fh->data, fh->size); p += DIV_ROUND_UP(fh->size, 4); return p; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,043
static uint32_t *nfs_add_filename(uint32_t *p, uint32_t filename_len, const char *filename) { *p++ = hton32(filename_len); /* zero padding */ if (filename_len & 3) p[filename_len / 4] = 0; memcpy(p, filename, filename_len); p += DIV_ROUND_UP(filename_len, 4); return p; }
Overflow
0
static uint32_t *nfs_add_filename(uint32_t *p, uint32_t filename_len, const char *filename) { *p++ = hton32(filename_len); /* zero padding */ if (filename_len & 3) p[filename_len / 4] = 0; memcpy(p, filename, filename_len); p += DIV_ROUND_UP(filename_len, 4); return p; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,044
static uint32_t *nfs_add_uint64(uint32_t *p, uint64_t val) { uint64_t nval = hton64(val); memcpy(p, &nval, 8); return p + 2; }
Overflow
0
static uint32_t *nfs_add_uint64(uint32_t *p, uint64_t val) { uint64_t nval = hton64(val); memcpy(p, &nval, 8); return p + 2; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,045
static struct inode *nfs_alloc_inode(struct super_block *sb) { struct nfs_inode *node; node = xzalloc(sizeof(*node)); if (!node) return NULL; return &node->inode; }
Overflow
0
static struct inode *nfs_alloc_inode(struct super_block *sb) { struct nfs_inode *node; node = xzalloc(sizeof(*node)); if (!node) return NULL; return &node->inode; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,046
static void nfs_do_close(struct file_priv *priv) { if (priv->fifo) kfifo_free(priv->fifo); free(priv); }
Overflow
0
static void nfs_do_close(struct file_priv *priv) { if (priv->fifo) kfifo_free(priv->fifo); free(priv); }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,047
static int nfs_fattr3_to_stat(uint32_t *p, struct inode *inode) { uint32_t mode; size_t i; if (!inode) return 0; /* offsetof(struct fattr3, type) = 0 */ switch (ntoh32(net_read_uint32(p + 0))) { case NF3REG: inode->i_mode = S_IFREG; break; case NF3DIR: inode->i_mode = S_IFDIR; break; case NF3BLK: ...
Overflow
0
static int nfs_fattr3_to_stat(uint32_t *p, struct inode *inode) { uint32_t mode; size_t i; if (!inode) return 0; /* offsetof(struct fattr3, type) = 0 */ switch (ntoh32(net_read_uint32(p + 0))) { case NF3REG: inode->i_mode = S_IFREG; break; case NF3DIR: inode->i_mode = S_IFDIR; break; case NF3BLK: ...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,048
static const char *nfs_get_link(struct dentry *dentry, struct inode *inode) { struct nfs_inode *ninode = nfsi(inode); struct nfs_priv *npriv = ninode->npriv; int ret; ret = nfs_readlink_req(npriv, &ninode->fh, &inode->i_link); if (ret) return ERR_PTR(ret); return inode->i_link; }
Overflow
0
static const char *nfs_get_link(struct dentry *dentry, struct inode *inode) { struct nfs_inode *ninode = nfsi(inode); struct nfs_priv *npriv = ninode->npriv; int ret; ret = nfs_readlink_req(npriv, &ninode->fh, &inode->i_link); if (ret) return ERR_PTR(ret); return inode->i_link; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,049
static int nfs_init(void) { rootnfsopts = xstrdup("v3,tcp"); globalvar_add_simple_string("linux.rootnfsopts", &rootnfsopts); return register_fs_driver(&nfs_driver); }
Overflow
0
static int nfs_init(void) { rootnfsopts = xstrdup("v3,tcp"); globalvar_add_simple_string("linux.rootnfsopts", &rootnfsopts); return register_fs_driver(&nfs_driver); }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,050
static int nfs_init_inode(struct nfs_priv *npriv, struct inode *inode, unsigned int mode) { struct nfs_inode *ninode = nfsi(inode); ninode->npriv = npriv; inode->i_ino = get_next_ino(); inode->i_mode = mode; switch (inode->i_mode & S_IFMT) { default: return -EINVAL; case S_IFREG: inode->i_op = &nfs_f...
Overflow
0
static int nfs_init_inode(struct nfs_priv *npriv, struct inode *inode, unsigned int mode) { struct nfs_inode *ninode = nfsi(inode); ninode->npriv = npriv; inode->i_ino = get_next_ino(); inode->i_mode = mode; switch (inode->i_mode & S_IFMT) { default: return -EINVAL; case S_IFREG: inode->i_op = &nfs_f...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,051
static int nfs_iterate(struct file *file, struct dir_context *ctx) { struct dentry *dentry = file->f_path.dentry; struct inode *dir = d_inode(dentry); struct nfs_priv *npriv = nfsi(dir)->npriv; void *buf = NULL; struct nfs_dir *ndir; struct xdr_stream *xdr; int ret; uint32_t *p, len; ndir = xzalloc(sizeof(*nd...
Overflow
0
static int nfs_iterate(struct file *file, struct dir_context *ctx) { struct dentry *dentry = file->f_path.dentry; struct inode *dir = d_inode(dentry); struct nfs_priv *npriv = nfsi(dir)->npriv; void *buf = NULL; struct nfs_dir *ndir; struct xdr_stream *xdr; int ret; uint32_t *p, len; ndir = xzalloc(sizeof(*nd...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,052
static int nfs_lseek(struct device_d *dev, FILE *file, loff_t pos) { struct file_priv *priv = file->priv; kfifo_reset(priv->fifo); return 0; }
Overflow
0
static int nfs_lseek(struct device_d *dev, FILE *file, loff_t pos) { struct file_priv *priv = file->priv; kfifo_reset(priv->fifo); return 0; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,053
static int nfs_mount_req(struct nfs_priv *npriv) { uint32_t data[1024]; uint32_t *p; int len; int pathlen; struct packet *nfs_packet; pathlen = strlen(npriv->path); debug("%s: %s\n", __func__, npriv->path); p = &(data[0]); p = rpc_add_credentials(p); *p++ = hton32(pathlen); if (pathlen & 3) *(p + pathl...
Overflow
0
static int nfs_mount_req(struct nfs_priv *npriv) { uint32_t data[1024]; uint32_t *p; int len; int pathlen; struct packet *nfs_packet; pathlen = strlen(npriv->path); debug("%s: %s\n", __func__, npriv->path); p = &(data[0]); p = rpc_add_credentials(p); *p++ = hton32(pathlen); if (pathlen & 3) *(p + pathl...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,054
static int nfs_open(struct device_d *dev, FILE *file, const char *filename) { struct inode *inode = file->f_inode; struct nfs_inode *ninode = nfsi(inode); struct nfs_priv *npriv = ninode->npriv; struct file_priv *priv; priv = xzalloc(sizeof(*priv)); priv->fh = ninode->fh; priv->npriv = npriv; file->priv = priv...
Overflow
0
static int nfs_open(struct device_d *dev, FILE *file, const char *filename) { struct inode *inode = file->f_inode; struct nfs_inode *ninode = nfsi(inode); struct nfs_priv *npriv = ninode->npriv; struct file_priv *priv; priv = xzalloc(sizeof(*priv)); priv->fh = ninode->fh; priv->npriv = npriv; file->priv = priv...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,055
static uint32_t *nfs_read_post_op_attr(uint32_t *p, struct inode *inode) { /* * union post_op_attr switch (bool attributes_follow) { * case TRUE: * fattr3 attributes; * case FALSE: * void; * }; */ if (ntoh32(net_read_uint32(p++))) { nfs_fattr3_to_stat(p, inode); p += 21; } return p; }
Overflow
0
static uint32_t *nfs_read_post_op_attr(uint32_t *p, struct inode *inode) { /* * union post_op_attr switch (bool attributes_follow) { * case TRUE: * fattr3 attributes; * case FALSE: * void; * }; */ if (ntoh32(net_read_uint32(p++))) { nfs_fattr3_to_stat(p, inode); p += 21; } return p; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,056
static int nfs_read_req(struct file_priv *priv, uint64_t offset, uint32_t readlen) { uint32_t data[1024]; uint32_t *p; int len; struct packet *nfs_packet; uint32_t rlen, eof; /* * struct READ3args { * nfs_fh3 file; * offset3 offset; * count3 count; * }; * * struct READ3resok { * post_op_att...
Overflow
0
static int nfs_read_req(struct file_priv *priv, uint64_t offset, uint32_t readlen) { uint32_t data[1024]; uint32_t *p; int len; struct packet *nfs_packet; uint32_t rlen, eof; /* * struct READ3args { * nfs_fh3 file; * offset3 offset; * count3 count; * }; * * struct READ3resok { * post_op_att...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,057
static void *nfs_readdirattr_req(struct nfs_priv *npriv, struct nfs_dir *dir) { uint32_t data[1024]; uint32_t *p; int len; struct packet *nfs_packet; void *buf; /* * struct READDIR3args { * nfs_fh3 dir; * cookie3 cookie; * cookieverf3 cookieverf; * count3 count; * }; * * struct entry3 { * ...
Overflow
0
static void *nfs_readdirattr_req(struct nfs_priv *npriv, struct nfs_dir *dir) { uint32_t data[1024]; uint32_t *p; int len; struct packet *nfs_packet; void *buf; /* * struct READDIR3args { * nfs_fh3 dir; * cookie3 cookie; * cookieverf3 cookieverf; * count3 count; * }; * * struct entry3 { * ...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,058
static void nfs_remove(struct device_d *dev) { struct nfs_priv *npriv = dev->priv; nfs_umount_req(npriv); net_unregister(npriv->con); free(npriv->path); free(npriv); }
Overflow
0
static void nfs_remove(struct device_d *dev) { struct nfs_priv *npriv = dev->priv; nfs_umount_req(npriv); net_unregister(npriv->con); free(npriv->path); free(npriv); }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,059
static void nfs_set_fh(struct inode *inode, struct nfs_fh *fh) { struct nfs_inode *ninode = nfsi(inode); ninode->fh = *fh; }
Overflow
0
static void nfs_set_fh(struct inode *inode, struct nfs_fh *fh) { struct nfs_inode *ninode = nfsi(inode); ninode->fh = *fh; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,060
static void nfs_set_rootarg(struct nfs_priv *npriv, struct fs_device_d *fsdev) { char *str, *tmp; const char *bootargs; str = basprintf("root=/dev/nfs nfsroot=%pI4:%s%s%s", &npriv->server, npriv->path, rootnfsopts[0] ? "," : "", rootnfsopts); /* forward specific mount options on demand */ if (npriv->manual_...
Overflow
0
static void nfs_set_rootarg(struct nfs_priv *npriv, struct fs_device_d *fsdev) { char *str, *tmp; const char *bootargs; str = basprintf("root=/dev/nfs nfsroot=%pI4:%s%s%s", &npriv->server, npriv->path, rootnfsopts[0] ? "," : "", rootnfsopts); /* forward specific mount options on demand */ if (npriv->manual_...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,061
static int nfs_truncate(struct device_d *dev, FILE *f, loff_t size) { return -ENOSYS; }
Overflow
0
static int nfs_truncate(struct device_d *dev, FILE *f, loff_t size) { return -ENOSYS; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,062
static void nfs_umount_req(struct nfs_priv *npriv) { uint32_t data[1024]; uint32_t *p; int len; int pathlen; struct packet *nfs_packet; pathlen = strlen(npriv->path); p = &(data[0]); p = rpc_add_credentials(p); p = nfs_add_filename(p, pathlen, npriv->path); len = p - &(data[0]); nfs_packet = rpc_req(npr...
Overflow
0
static void nfs_umount_req(struct nfs_priv *npriv) { uint32_t data[1024]; uint32_t *p; int len; int pathlen; struct packet *nfs_packet; pathlen = strlen(npriv->path); p = &(data[0]); p = rpc_add_credentials(p); p = nfs_add_filename(p, pathlen, npriv->path); len = p - &(data[0]); nfs_packet = rpc_req(npr...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,063
static int nfs_write(struct device_d *_dev, FILE *file, const void *inbuf, size_t insize) { return -ENOSYS; }
Overflow
0
static int nfs_write(struct device_d *_dev, FILE *file, const void *inbuf, size_t insize) { return -ENOSYS; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,064
static inline struct nfs_inode *nfsi(struct inode *inode) { return container_of(inode, struct nfs_inode, inode); }
Overflow
0
static inline struct nfs_inode *nfsi(struct inode *inode) { return container_of(inode, struct nfs_inode, inode); }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,065
static uint32_t *rpc_add_credentials(uint32_t *p) { /* * *BSD refuses AUTH_NONE, so use AUTH_UNIX. An empty hostname is OK for * both Linux and *BSD. */ /* Provide an AUTH_UNIX credential. */ *p++ = hton32(1); /* AUTH_UNIX */ *p++ = hton32(20); /* auth length: 20 + strlen(hostname) */ *p++ = hton32(0); ...
Overflow
0
static uint32_t *rpc_add_credentials(uint32_t *p) { /* * *BSD refuses AUTH_NONE, so use AUTH_UNIX. An empty hostname is OK for * both Linux and *BSD. */ /* Provide an AUTH_UNIX credential. */ *p++ = hton32(1); /* AUTH_UNIX */ *p++ = hton32(20); /* auth length: 20 + strlen(hostname) */ *p++ = hton32(0); ...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,066
static int rpc_lookup_req(struct nfs_priv *npriv, uint32_t prog, uint32_t ver) { uint32_t data[16]; struct packet *nfs_packet; uint32_t port; data[0] = 0; data[1] = 0; /* auth credential */ data[2] = 0; data[3] = 0; /* auth verifier */ data[4] = hton32(prog); data[5] = hton32(ver); data[6] = hton32(17); /* IP_...
Overflow
0
static int rpc_lookup_req(struct nfs_priv *npriv, uint32_t prog, uint32_t ver) { uint32_t data[16]; struct packet *nfs_packet; uint32_t port; data[0] = 0; data[1] = 0; /* auth credential */ data[2] = 0; data[3] = 0; /* auth verifier */ data[4] = hton32(prog); data[5] = hton32(ver); data[6] = hton32(17); /* IP_...
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,067
static void xdr_init(struct xdr_stream *stream, void *buf, int len) { stream->p = stream->buf = buf; stream->end = stream->buf + len; }
Overflow
0
static void xdr_init(struct xdr_stream *stream, void *buf, int len) { stream->p = stream->buf = buf; stream->end = stream->buf + len; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,068
static __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes) { __be32 *p; if (nbytes == 0) return xdr->p; if (xdr->p == xdr->end) return NULL; p = __xdr_inline_decode(xdr, nbytes); return p; }
Overflow
0
static __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes) { __be32 *p; if (nbytes == 0) return xdr->p; if (xdr->p == xdr->end) return NULL; p = __xdr_inline_decode(xdr, nbytes); return p; }
@@ -1023,6 +1023,10 @@ static int nfs_readlink_req(struct nfs_priv *npriv, struct nfs_fh *fh, p = nfs_read_post_op_attr(p, NULL); len = ntoh32(net_read_uint32(p)); /* new path length */ + + len = max_t(unsigned int, len, + nfs_packet->len - sizeof(struct rpc_reply) - sizeof(uint32_t)); + p++; *target =...
CWE-119
null
null
1,069
static int nfs_mount_reply(unsigned char *pkt, unsigned len) { int ret; ret = rpc_check_reply(pkt, 1); if (ret) return ret; memcpy(dirfh, pkt + sizeof(struct rpc_reply) + 4, NFS_FHSIZE); return 0; }
Overflow
0
static int nfs_mount_reply(unsigned char *pkt, unsigned len) { int ret; ret = rpc_check_reply(pkt, 1); if (ret) return ret; memcpy(dirfh, pkt + sizeof(struct rpc_reply) + 4, NFS_FHSIZE); return 0; }
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,070
static void nfs_read_req(int offset, int readlen) { uint32_t data[1024]; uint32_t *p; int len; p = &(data[0]); p = rpc_add_credentials(p); memcpy (p, filefh, NFS_FHSIZE); p += (NFS_FHSIZE / 4); *p++ = htonl(offset); *p++ = htonl(readlen); *p++ = 0; len = p - &(data[0]); rpc_req(PROG_NFS, NFS_READ, data,...
Overflow
0
static void nfs_read_req(int offset, int readlen) { uint32_t data[1024]; uint32_t *p; int len; p = &(data[0]); p = rpc_add_credentials(p); memcpy (p, filefh, NFS_FHSIZE); p += (NFS_FHSIZE / 4); *p++ = htonl(offset); *p++ = htonl(readlen); *p++ = 0; len = p - &(data[0]); rpc_req(PROG_NFS, NFS_READ, data,...
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,071
static void nfs_readlink_req(void) { uint32_t data[1024]; uint32_t *p; int len; p = &(data[0]); p = rpc_add_credentials(p); memcpy (p, filefh, NFS_FHSIZE); p += (NFS_FHSIZE / 4); len = p - &(data[0]); rpc_req(PROG_NFS, NFS_READLINK, data, len); }
Overflow
0
static void nfs_readlink_req(void) { uint32_t data[1024]; uint32_t *p; int len; p = &(data[0]); p = rpc_add_credentials(p); memcpy (p, filefh, NFS_FHSIZE); p += (NFS_FHSIZE / 4); len = p - &(data[0]); rpc_req(PROG_NFS, NFS_READLINK, data, len); }
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,072
static void nfs_send(void) { debug("%s\n", __func__); switch (nfs_state) { case STATE_PRCLOOKUP_PROG_MOUNT_REQ: rpc_lookup_req(PROG_MOUNT, 1); break; case STATE_PRCLOOKUP_PROG_NFS_REQ: rpc_lookup_req(PROG_NFS, 2); break; case STATE_MOUNT_REQ: nfs_mount_req(nfs_path); break; case STATE_UMOUNT_REQ: n...
Overflow
0
static void nfs_send(void) { debug("%s\n", __func__); switch (nfs_state) { case STATE_PRCLOOKUP_PROG_MOUNT_REQ: rpc_lookup_req(PROG_MOUNT, 1); break; case STATE_PRCLOOKUP_PROG_NFS_REQ: rpc_lookup_req(PROG_NFS, 2); break; case STATE_MOUNT_REQ: nfs_mount_req(nfs_path); break; case STATE_UMOUNT_REQ: n...
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,073
static int nfs_umountall_reply(unsigned char *pkt, unsigned len) { int ret; ret = rpc_check_reply(pkt, 0); if (ret) return ret; memset(dirfh, 0, sizeof(dirfh)); return 0; }
Overflow
0
static int nfs_umountall_reply(unsigned char *pkt, unsigned len) { int ret; ret = rpc_check_reply(pkt, 0); if (ret) return ret; memset(dirfh, 0, sizeof(dirfh)); return 0; }
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,074
static void nfs_umountall_req(void) { uint32_t data[1024]; uint32_t *p; int len; if (nfs_server_mount_port < 0) /* Nothing mounted, nothing to umount */ return; p = &(data[0]); p = rpc_add_credentials(p); len = p - &(data[0]); rpc_req(PROG_MOUNT, MOUNT_UMOUNTALL, data, len); }
Overflow
0
static void nfs_umountall_req(void) { uint32_t data[1024]; uint32_t *p; int len; if (nfs_server_mount_port < 0) /* Nothing mounted, nothing to umount */ return; p = &(data[0]); p = rpc_add_credentials(p); len = p - &(data[0]); rpc_req(PROG_MOUNT, MOUNT_UMOUNTALL, data, len); }
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,075
static uint32_t *rpc_add_credentials(uint32_t *p) { int hl; int hostnamelen = 0; /* Here's the executive summary on authentication requirements of the * various NFS server implementations: Linux accepts both AUTH_NONE * and AUTH_UNIX authentication (also accepts an empty hostname field * in the AUTH_UNIX sche...
Overflow
0
static uint32_t *rpc_add_credentials(uint32_t *p) { int hl; int hostnamelen = 0; /* Here's the executive summary on authentication requirements of the * various NFS server implementations: Linux accepts both AUTH_NONE * and AUTH_UNIX authentication (also accepts an empty hostname field * in the AUTH_UNIX sche...
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,076
static int rpc_check_reply(unsigned char *pkt, int isnfs) { uint32_t *data; int nfserr; struct rpc_reply rpc; memcpy(&rpc, pkt, sizeof(rpc)); if (ntohl(rpc.id) != rpc_id) return -EINVAL; if (rpc.rstatus || rpc.verifier || rpc.astatus ) { return -EINVAL; } if (!isnfs) return 0; data = (uin...
Overflow
0
static int rpc_check_reply(unsigned char *pkt, int isnfs) { uint32_t *data; int nfserr; struct rpc_reply rpc; memcpy(&rpc, pkt, sizeof(rpc)); if (ntohl(rpc.id) != rpc_id) return -EINVAL; if (rpc.rstatus || rpc.verifier || rpc.astatus ) { return -EINVAL; } if (!isnfs) return 0; data = (uin...
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,077
static int rpc_lookup_reply(int prog, unsigned char *pkt, unsigned len) { uint32_t port; int ret; ret = rpc_check_reply(pkt, 0); if (ret) return ret; port = net_read_uint32((uint32_t *)(pkt + sizeof(struct rpc_reply))); switch (prog) { case PROG_MOUNT: nfs_server_mount_port = ntohl(port); break; case PR...
Overflow
0
static int rpc_lookup_reply(int prog, unsigned char *pkt, unsigned len) { uint32_t port; int ret; ret = rpc_check_reply(pkt, 0); if (ret) return ret; port = net_read_uint32((uint32_t *)(pkt + sizeof(struct rpc_reply))); switch (prog) { case PROG_MOUNT: nfs_server_mount_port = ntohl(port); break; case PR...
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,078
static void rpc_lookup_req(int prog, int ver) { uint32_t data[16]; data[0] = 0; data[1] = 0; /* auth credential */ data[2] = 0; data[3] = 0; /* auth verifier */ data[4] = htonl(prog); data[5] = htonl(ver); data[6] = htonl(17); /* IP_UDP */ data[7] = 0; rpc_req(PROG_PORTMAP, PORTMAP_GETPORT, data, 8); }
Overflow
0
static void rpc_lookup_req(int prog, int ver) { uint32_t data[16]; data[0] = 0; data[1] = 0; /* auth credential */ data[2] = 0; data[3] = 0; /* auth verifier */ data[4] = htonl(prog); data[5] = htonl(ver); data[6] = htonl(17); /* IP_UDP */ data[7] = 0; rpc_req(PROG_PORTMAP, PORTMAP_GETPORT, data, 8); }
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,079
static int rpc_req(int rpc_prog, int rpc_proc, uint32_t *data, int datalen) { struct rpc_call pkt; unsigned long id; int sport; int ret; unsigned char *payload = net_udp_get_payload(nfs_con); id = ++rpc_id; pkt.id = htonl(id); pkt.type = htonl(MSG_CALL); pkt.rpcvers = htonl(2); /* use RPC version 2 */ pkt.pr...
Overflow
0
static int rpc_req(int rpc_prog, int rpc_proc, uint32_t *data, int datalen) { struct rpc_call pkt; unsigned long id; int sport; int ret; unsigned char *payload = net_udp_get_payload(nfs_con); id = ++rpc_id; pkt.id = htonl(id); pkt.type = htonl(MSG_CALL); pkt.rpcvers = htonl(2); /* use RPC version 2 */ pkt.pr...
@@ -502,7 +502,7 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) { uint32_t *data; char *path; - int rlen; + unsigned int rlen; int ret; ret = rpc_check_reply(pkt, 1); @@ -515,6 +515,9 @@ static int nfs_readlink_reply(unsigned char *pkt, unsigned len) rlen = ntohl(net_read_uint32(data)...
CWE-119
null
null
1,080
XcursorFileLoadImages (FILE *file, int size) { XcursorFile f; if (!file) return NULL; _XcursorStdioFileInitialize (file, &f); return XcursorXcFileLoadImages (&f, size); }
Overflow
0
XcursorFileLoadImages (FILE *file, int size) { XcursorFile f; if (!file) return NULL; _XcursorStdioFileInitialize (file, &f); return XcursorXcFileLoadImages (&f, size); }
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,081
XcursorImagesCreate (int size) { XcursorImages *images; images = malloc (sizeof (XcursorImages) + size * sizeof (XcursorImage *)); if (!images) return NULL; images->nimage = 0; images->images = (XcursorImage **) (images + 1); images->name = NULL; return images; }
Overflow
0
XcursorImagesCreate (int size) { XcursorImages *images; images = malloc (sizeof (XcursorImages) + size * sizeof (XcursorImage *)); if (!images) return NULL; images->nimage = 0; images->images = (XcursorImage **) (images + 1); images->name = NULL; return images; }
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,082
XcursorImagesDestroy (XcursorImages *images) { int n; if (!images) return; for (n = 0; n < images->nimage; n++) XcursorImageDestroy (images->images[n]); if (images->name) free (images->name); free (images); }
Overflow
0
XcursorImagesDestroy (XcursorImages *images) { int n; if (!images) return; for (n = 0; n < images->nimage; n++) XcursorImageDestroy (images->images[n]); if (images->name) free (images->name); free (images); }
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,083
XcursorImagesSetName (XcursorImages *images, const char *name) { char *new; if (!images || !name) return; new = malloc (strlen (name) + 1); if (!new) return; strcpy (new, name); if (images->name) free (images->name); images->name = new; }
Overflow
0
XcursorImagesSetName (XcursorImages *images, const char *name) { char *new; if (!images || !name) return; new = malloc (strlen (name) + 1); if (!new) return; strcpy (new, name); if (images->name) free (images->name); images->name = new; }
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,084
XcursorLibraryLoadImages (const char *file, const char *theme, int size) { FILE *f = NULL; XcursorImages *images = NULL; if (!file) return NULL; if (theme) f = XcursorScanTheme (theme, file); if (!f) f = XcursorScanTheme ("default", file); if (f) { images = XcursorFileLoad...
Overflow
0
XcursorLibraryLoadImages (const char *file, const char *theme, int size) { FILE *f = NULL; XcursorImages *images = NULL; if (!file) return NULL; if (theme) f = XcursorScanTheme (theme, file); if (!f) f = XcursorScanTheme ("default", file); if (f) { images = XcursorFileLoad...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,085
XcursorScanTheme (const char *theme, const char *name) { FILE *f = NULL; char *full; char *dir; const char *path; char *inherits = NULL; const char *i; if (!theme || !name) return NULL; /* * Scan this theme */ for (path = XcursorLibraryPath (); path && f == NUL...
Overflow
0
XcursorScanTheme (const char *theme, const char *name) { FILE *f = NULL; char *full; char *dir; const char *path; char *inherits = NULL; const char *i; if (!theme || !name) return NULL; /* * Scan this theme */ for (path = XcursorLibraryPath (); path && f == NUL...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,086
XcursorXcFileLoadImages (XcursorFile *file, int size) { XcursorFileHeader *fileHeader; XcursorDim bestSize; int nsize; XcursorImages *images; int n; int toc; if (!file || size < 0) return NULL; fileHeader = _XcursorReadFileHeader (file); if (!fileHeader) return NULL; be...
Overflow
0
XcursorXcFileLoadImages (XcursorFile *file, int size) { XcursorFileHeader *fileHeader; XcursorDim bestSize; int nsize; XcursorImages *images; int n; int toc; if (!file || size < 0) return NULL; fileHeader = _XcursorReadFileHeader (file); if (!fileHeader) return NULL; be...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,087
_XcursorAddPathElt (char *path, const char *elt, int len) { int pathlen = strlen (path); /* append / if the path doesn't currently have one */ if (path[0] == '\0' || path[pathlen - 1] != '/') { strcat (path, "/"); pathlen++; } if (len == -1) len = strlen (elt); /* strip leading slash...
Overflow
0
_XcursorAddPathElt (char *path, const char *elt, int len) { int pathlen = strlen (path); /* append / if the path doesn't currently have one */ if (path[0] == '\0' || path[pathlen - 1] != '/') { strcat (path, "/"); pathlen++; } if (len == -1) len = strlen (elt); /* strip leading slash...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,088
_XcursorBuildFullname (const char *dir, const char *subdir, const char *file) { char *full; if (!dir || !subdir || !file) return NULL; full = malloc (strlen (dir) + 1 + strlen (subdir) + 1 + strlen (file) + 1); if (!full) return NULL; full[0] = '\0'; _XcursorAddPathElt (full, dir, ...
Overflow
0
_XcursorBuildFullname (const char *dir, const char *subdir, const char *file) { char *full; if (!dir || !subdir || !file) return NULL; full = malloc (strlen (dir) + 1 + strlen (subdir) + 1 + strlen (file) + 1); if (!full) return NULL; full[0] = '\0'; _XcursorAddPathElt (full, dir, ...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,089
_XcursorBuildThemeDir (const char *dir, const char *theme) { const char *colon; const char *tcolon; char *full; char *home; int dirlen; int homelen; int themelen; int len; if (!dir || !theme) return NULL; colon = strchr (dir, ':'); ...
Overflow
0
_XcursorBuildThemeDir (const char *dir, const char *theme) { const char *colon; const char *tcolon; char *full; char *home; int dirlen; int homelen; int themelen; int len; if (!dir || !theme) return NULL; colon = strchr (dir, ':'); ...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,090
_XcursorFileHeaderCreate (int ntoc) { XcursorFileHeader *fileHeader; if (ntoc > 0x10000) return NULL; fileHeader = malloc (sizeof (XcursorFileHeader) + ntoc * sizeof (XcursorFileToc)); if (!fileHeader) return NULL; fileHeader->magic = XCURSOR_MAGIC; fileHeader->header = XCURSOR_FILE_HEADE...
Overflow
0
_XcursorFileHeaderCreate (int ntoc) { XcursorFileHeader *fileHeader; if (ntoc > 0x10000) return NULL; fileHeader = malloc (sizeof (XcursorFileHeader) + ntoc * sizeof (XcursorFileToc)); if (!fileHeader) return NULL; fileHeader->magic = XCURSOR_MAGIC; fileHeader->header = XCURSOR_FILE_HEADE...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,091
_XcursorFileReadChunkHeader (XcursorFile *file, XcursorFileHeader *fileHeader, int toc, XcursorChunkHeader *chunkHeader) { if (!file || !fileHeader || !chunkHeader) return XcursorFalse; if (!_XcursorSeekToToc (file, fileHeader, toc)) return XcursorFalse; if (!_XcursorReadUI...
Overflow
0
_XcursorFileReadChunkHeader (XcursorFile *file, XcursorFileHeader *fileHeader, int toc, XcursorChunkHeader *chunkHeader) { if (!file || !fileHeader || !chunkHeader) return XcursorFalse; if (!_XcursorSeekToToc (file, fileHeader, toc)) return XcursorFalse; if (!_XcursorReadUI...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,092
_XcursorFindBestSize (XcursorFileHeader *fileHeader, XcursorDim size, int *nsizesp) { unsigned int n; int nsizes = 0; XcursorDim bestSize = 0; XcursorDim thisSize; if (!fileHeader || !nsizesp) return 0; for (n = 0; n < fileHeader->ntoc; n++) { if (fileHeader->toc...
Overflow
0
_XcursorFindBestSize (XcursorFileHeader *fileHeader, XcursorDim size, int *nsizesp) { unsigned int n; int nsizes = 0; XcursorDim bestSize = 0; XcursorDim thisSize; if (!fileHeader || !nsizesp) return 0; for (n = 0; n < fileHeader->ntoc; n++) { if (fileHeader->toc...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,093
_XcursorFindImageToc (XcursorFileHeader *fileHeader, XcursorDim size, int count) { unsigned int toc; XcursorDim thisSize; if (!fileHeader) return 0; for (toc = 0; toc < fileHeader->ntoc; toc++) { if (fileHeader->tocs[toc].type != XCURSOR_IMAGE_TYPE) continue; thisS...
Overflow
0
_XcursorFindImageToc (XcursorFileHeader *fileHeader, XcursorDim size, int count) { unsigned int toc; XcursorDim thisSize; if (!fileHeader) return 0; for (toc = 0; toc < fileHeader->ntoc; toc++) { if (fileHeader->tocs[toc].type != XCURSOR_IMAGE_TYPE) continue; thisS...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,094
_XcursorReadFileHeader (XcursorFile *file) { XcursorFileHeader head, *fileHeader; XcursorUInt skip; unsigned int n; if (!file) return NULL; if (!_XcursorReadUInt (file, &head.magic)) return NULL; if (head.magic != XCURSOR_MAGIC) return NULL; if (!_XcursorReadUInt (file, &head.he...
Overflow
0
_XcursorReadFileHeader (XcursorFile *file) { XcursorFileHeader head, *fileHeader; XcursorUInt skip; unsigned int n; if (!file) return NULL; if (!_XcursorReadUInt (file, &head.magic)) return NULL; if (head.magic != XCURSOR_MAGIC) return NULL; if (!_XcursorReadUInt (file, &head.he...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,095
_XcursorReadUInt (XcursorFile *file, XcursorUInt *u) { unsigned char bytes[4]; if (!file || !u) return XcursorFalse; if ((*file->read) (file, bytes, 4) != 4) return XcursorFalse; *u = ((bytes[0] << 0) | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24)); return XcursorTrue;...
Overflow
0
_XcursorReadUInt (XcursorFile *file, XcursorUInt *u) { unsigned char bytes[4]; if (!file || !u) return XcursorFalse; if ((*file->read) (file, bytes, 4) != 4) return XcursorFalse; *u = ((bytes[0] << 0) | (bytes[1] << 8) | (bytes[2] << 16) | (bytes[3] << 24)); return XcursorTrue;...
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,096
_XcursorSeekToToc (XcursorFile *file, XcursorFileHeader *fileHeader, int toc) { if (!file || !fileHeader || \ (*file->seek) (file, fileHeader->tocs[toc].position, SEEK_SET) == EOF) return XcursorFalse; return XcursorTrue; }
Overflow
0
_XcursorSeekToToc (XcursorFile *file, XcursorFileHeader *fileHeader, int toc) { if (!file || !fileHeader || \ (*file->seek) (file, fileHeader->tocs[toc].position, SEEK_SET) == EOF) return XcursorFalse; return XcursorTrue; }
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,097
_XcursorStdioFileRead (XcursorFile *file, unsigned char *buf, int len) { FILE *f = file->closure; return fread (buf, 1, len, f); }
Overflow
0
_XcursorStdioFileRead (XcursorFile *file, unsigned char *buf, int len) { FILE *f = file->closure; return fread (buf, 1, len, f); }
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,098
_XcursorStdioFileSeek (XcursorFile *file, long offset, int whence) { FILE *f = file->closure; return fseek (f, offset, whence); }
Overflow
0
_XcursorStdioFileSeek (XcursorFile *file, long offset, int whence) { FILE *f = file->closure; return fseek (f, offset, whence); }
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null
1,099
_XcursorStdioFileWrite (XcursorFile *file, unsigned char *buf, int len) { FILE *f = file->closure; return fwrite (buf, 1, len, f); }
Overflow
0
_XcursorStdioFileWrite (XcursorFile *file, unsigned char *buf, int len) { FILE *f = file->closure; return fwrite (buf, 1, len, f); }
@@ -202,6 +202,11 @@ XcursorImageCreate (int width, int height) { XcursorImage *image; + if (width < 0 || height < 0) + return NULL; + if (width > XCURSOR_IMAGE_MAX_SIZE || height > XCURSOR_IMAGE_MAX_SIZE) + return NULL; + image = malloc (sizeof (XcursorImage) + width * height *...
CWE-190
null
null