CVE ID
stringlengths
13
43
CVE Page
stringlengths
45
48
CWE ID
stringclasses
90 values
codeLink
stringlengths
46
139
commit_id
stringlengths
6
81
commit_message
stringlengths
3
13.3k
func_after
stringlengths
14
241k
func_before
stringlengths
14
241k
lang
stringclasses
3 values
project
stringclasses
309 values
vul
int8
0
1
CVE-2019-11922
https://www.cvedetails.com/cve/CVE-2019-11922/
CWE-362
https://github.com/facebook/zstd/pull/1404/commits/3e5cdf1b6a85843e991d7d10f6a2567c15580da0
3e5cdf1b6a85843e991d7d10f6a2567c15580da0
fixed T36302429
ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long srcSizeHint, size_t dictSize) { ZSTD_parameters params; ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, srcSizeHint, dictSize); DEBUGLOG(5, "ZSTD_getParams (cLevel=%i)", compressionLevel); memset(&params, 0, sizeof(params)); params.cParams = cParams; params.fParams.contentSizeFlag = 1; return params; }
ZSTD_parameters ZSTD_getParams(int compressionLevel, unsigned long long srcSizeHint, size_t dictSize) { ZSTD_parameters params; ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, srcSizeHint, dictSize); DEBUGLOG(5, "ZSTD_getParams (cLevel=%i)", compressionLevel); memset(&params, 0, sizeof(params)); params.cParams = cParams; params.fParams.contentSizeFlag = 1; return params; }
C
zstd
0
CVE-2013-0922
https://www.cvedetails.com/cve/CVE-2013-0922/
CWE-264
https://github.com/chromium/chromium/commit/28aaa72a03df96fa1934876b0efbbc7e6b4b38af
28aaa72a03df96fa1934876b0efbbc7e6b4b38af
Revert cross-origin auth prompt blocking. BUG=174129 Review URL: https://chromiumcodereview.appspot.com/12183030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181113 0039d316-1c4b-4281-b951-d872f2087c98
bool ResourceDispatcherHostImpl::AcceptAuthRequest( ResourceLoader* loader, net::AuthChallengeInfo* auth_info) { if (delegate_ && !delegate_->AcceptAuthRequest(loader->request(), auth_info)) return false; if (!auth_info->is_proxy) { HttpAuthResourceType resource_type = HttpAuthResourceTypeOf(loader->request()); UMA_HISTOGRAM_ENUMERATION("Net.HttpAuthResource", resource_type, HTTP_AUTH_RESOURCE_LAST); // TODO(tsepez): Return false on HTTP_AUTH_RESOURCE_BLOCKED_CROSS. // The code once did this, but was changed due to http://crbug.com/174129. // http://crbug.com/174179 has been filed to track this issue. } return true; }
bool ResourceDispatcherHostImpl::AcceptAuthRequest( ResourceLoader* loader, net::AuthChallengeInfo* auth_info) { if (delegate_ && !delegate_->AcceptAuthRequest(loader->request(), auth_info)) return false; if (!auth_info->is_proxy) { HttpAuthResourceType resource_type = HttpAuthResourceTypeOf(loader->request()); UMA_HISTOGRAM_ENUMERATION("Net.HttpAuthResource", resource_type, HTTP_AUTH_RESOURCE_LAST); if (resource_type == HTTP_AUTH_RESOURCE_BLOCKED_CROSS) return false; } return true; }
C
Chrome
1
CVE-2016-5170
https://www.cvedetails.com/cve/CVE-2016-5170/
CWE-416
https://github.com/chromium/chromium/commit/c3957448cfc6e299165196a33cd954b790875fdb
c3957448cfc6e299165196a33cd954b790875fdb
Cleanup and remove dead code in SetFocusedElement This early-out was added in: https://crrev.com/ce8ea3446283965c7eabab592cbffe223b1cf2bc Back then, we applied fragment focus in LayoutUpdated() which could cause this issue. This got cleaned up in: https://crrev.com/45236fd563e9df53dc45579be1f3d0b4784885a2 so that focus is no longer applied after layout. +Cleanup: Goto considered harmful Bug: 795381 Change-Id: Ifeb4d2e03e872fd48cca6720b1d4de36ad1ecbb7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524417 Commit-Queue: David Bokan <[email protected]> Reviewed-by: Stefan Zager <[email protected]> Cr-Commit-Position: refs/heads/master@{#641101}
KURL Document::CompleteURLWithOverride(const String& url, const KURL& base_url_override) const { DCHECK(base_url_override.IsEmpty() || base_url_override.IsValid()); if (url.IsNull()) return KURL(); if (!Encoding().IsValid()) return KURL(base_url_override, url); return KURL(base_url_override, url, Encoding()); }
KURL Document::CompleteURLWithOverride(const String& url, const KURL& base_url_override) const { DCHECK(base_url_override.IsEmpty() || base_url_override.IsValid()); if (url.IsNull()) return KURL(); if (!Encoding().IsValid()) return KURL(base_url_override, url); return KURL(base_url_override, url, Encoding()); }
C
Chrome
0
CVE-2016-1683
https://www.cvedetails.com/cve/CVE-2016-1683/
CWE-119
https://github.com/chromium/chromium/commit/96dbafe288dbe2f0cc45fa3c39daf6d0c37acbab
96dbafe288dbe2f0cc45fa3c39daf6d0c37acbab
Roll libxslt to 891681e3e948f31732229f53cb6db7215f740fc7 BUG=583156,583171 Review URL: https://codereview.chromium.org/1853083002 Cr-Commit-Position: refs/heads/master@{#385338}
xsltFreeStackElemList(xsltStackElemPtr elem) { xsltStackElemPtr next; while (elem != NULL) { next = elem->next; xsltFreeStackElem(elem); elem = next; } }
xsltFreeStackElemList(xsltStackElemPtr elem) { xsltStackElemPtr next; while (elem != NULL) { next = elem->next; xsltFreeStackElem(elem); elem = next; } }
C
Chrome
0
CVE-2016-10046
https://www.cvedetails.com/cve/CVE-2016-10046/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/989f9f88ea6db09b99d25586e912c921c0da8d3f
989f9f88ea6db09b99d25586e912c921c0da8d3f
Prevent buffer overflow (bug report from Max Thrane)
MagickExport MagickBooleanType DrawPrimitive(Image *image, const DrawInfo *draw_info,const PrimitiveInfo *primitive_info) { CacheView *image_view; ExceptionInfo *exception; MagickStatusType status; register ssize_t i, x; ssize_t y; if (image->debug != MagickFalse) { (void) LogMagickEvent(DrawEvent,GetMagickModule(), " begin draw-primitive"); (void) LogMagickEvent(DrawEvent,GetMagickModule(), " affine: %g,%g,%g,%g,%g,%g",draw_info->affine.sx, draw_info->affine.rx,draw_info->affine.ry,draw_info->affine.sy, draw_info->affine.tx,draw_info->affine.ty); } exception=(&image->exception); if ((IsGrayColorspace(image->colorspace) != MagickFalse) && ((IsPixelGray(&draw_info->fill) == MagickFalse) || (IsPixelGray(&draw_info->stroke) == MagickFalse))) (void) SetImageColorspace(image,sRGBColorspace); status=MagickTrue; x=(ssize_t) ceil(primitive_info->point.x-0.5); y=(ssize_t) ceil(primitive_info->point.y-0.5); image_view=AcquireAuthenticCacheView(image,exception); switch (primitive_info->primitive) { case PointPrimitive: { PixelPacket fill_color; PixelPacket *q; if ((y < 0) || (y >= (ssize_t) image->rows)) break; if ((x < 0) || (x >= (ssize_t) image->columns)) break; q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,exception); if (q == (PixelPacket *) NULL) break; (void) GetFillColor(draw_info,x,y,&fill_color); MagickCompositeOver(&fill_color,(MagickRealType) fill_color.opacity,q, (MagickRealType) q->opacity,q); status&=SyncCacheViewAuthenticPixels(image_view,exception); break; } case ColorPrimitive: { switch (primitive_info->method) { case PointMethod: default: { PixelPacket *q; q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,exception); if (q == (PixelPacket *) NULL) break; (void) GetFillColor(draw_info,x,y,q); status&=SyncCacheViewAuthenticPixels(image_view,exception); break; } case ReplaceMethod: { MagickBooleanType sync; PixelPacket target; status&=GetOneCacheViewVirtualPixel(image_view,x,y,&target,exception); for (y=0; y < (ssize_t) image->rows; y++) { register PixelPacket *magick_restrict q; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1, exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { if (IsColorSimilar(image,q,&target) == MagickFalse) { q++; continue; } (void) GetFillColor(draw_info,x,y,q); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) break; } break; } case FloodfillMethod: case FillToBorderMethod: { MagickPixelPacket target; (void) GetOneVirtualMagickPixel(image,x,y,&target,exception); if (primitive_info->method == FillToBorderMethod) { target.red=(MagickRealType) draw_info->border_color.red; target.green=(MagickRealType) draw_info->border_color.green; target.blue=(MagickRealType) draw_info->border_color.blue; } status&=FloodfillPaintImage(image,DefaultChannels,draw_info,&target,x, y,primitive_info->method == FloodfillMethod ? MagickFalse : MagickTrue); break; } case ResetMethod: { MagickBooleanType sync; for (y=0; y < (ssize_t) image->rows; y++) { register PixelPacket *magick_restrict q; register ssize_t x; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1, exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { (void) GetFillColor(draw_info,x,y,q); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) break; } break; } } break; } case MattePrimitive: { if (image->matte == MagickFalse) (void) SetImageAlphaChannel(image,OpaqueAlphaChannel); switch (primitive_info->method) { case PointMethod: default: { PixelPacket pixel; PixelPacket *q; q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,exception); if (q == (PixelPacket *) NULL) break; (void) GetFillColor(draw_info,x,y,&pixel); SetPixelOpacity(q,pixel.opacity); status&=SyncCacheViewAuthenticPixels(image_view,exception); break; } case ReplaceMethod: { MagickBooleanType sync; PixelPacket pixel, target; status&=GetOneCacheViewVirtualPixel(image_view,x,y,&target,exception); for (y=0; y < (ssize_t) image->rows; y++) { register PixelPacket *magick_restrict q; register ssize_t x; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1, exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { if (IsColorSimilar(image,q,&target) == MagickFalse) { q++; continue; } (void) GetFillColor(draw_info,x,y,&pixel); SetPixelOpacity(q,pixel.opacity); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) break; } break; } case FloodfillMethod: case FillToBorderMethod: { MagickPixelPacket target; (void) GetOneVirtualMagickPixel(image,x,y,&target,exception); if (primitive_info->method == FillToBorderMethod) { target.red=(MagickRealType) draw_info->border_color.red; target.green=(MagickRealType) draw_info->border_color.green; target.blue=(MagickRealType) draw_info->border_color.blue; } status&=FloodfillPaintImage(image,OpacityChannel,draw_info,&target,x, y,primitive_info->method == FloodfillMethod ? MagickFalse : MagickTrue); break; } case ResetMethod: { MagickBooleanType sync; PixelPacket pixel; for (y=0; y < (ssize_t) image->rows; y++) { register PixelPacket *magick_restrict q; register ssize_t x; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1, exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { (void) GetFillColor(draw_info,x,y,&pixel); SetPixelOpacity(q,pixel.opacity); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) break; } break; } } break; } case TextPrimitive: { char geometry[MaxTextExtent]; DrawInfo *clone_info; if (primitive_info->text == (char *) NULL) break; clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); (void) CloneString(&clone_info->text,primitive_info->text); (void) FormatLocaleString(geometry,MaxTextExtent,"%+f%+f", primitive_info->point.x,primitive_info->point.y); (void) CloneString(&clone_info->geometry,geometry); status&=AnnotateImage(image,clone_info); clone_info=DestroyDrawInfo(clone_info); break; } case ImagePrimitive: { AffineMatrix affine; char composite_geometry[MaxTextExtent]; Image *composite_image; ImageInfo *clone_info; RectangleInfo geometry; ssize_t x1, y1; if (primitive_info->text == (char *) NULL) break; clone_info=AcquireImageInfo(); if (LocaleNCompare(primitive_info->text,"data:",5) == 0) composite_image=ReadInlineImage(clone_info,primitive_info->text, &image->exception); else { (void) CopyMagickString(clone_info->filename,primitive_info->text, MaxTextExtent); composite_image=ReadImage(clone_info,&image->exception); } clone_info=DestroyImageInfo(clone_info); if (composite_image == (Image *) NULL) break; (void) SetImageProgressMonitor(composite_image,(MagickProgressMonitor) NULL,(void *) NULL); x1=(ssize_t) ceil(primitive_info[1].point.x-0.5); y1=(ssize_t) ceil(primitive_info[1].point.y-0.5); if (((x1 != 0L) && (x1 != (ssize_t) composite_image->columns)) || ((y1 != 0L) && (y1 != (ssize_t) composite_image->rows))) { char geometry[MaxTextExtent]; /* Resize image. */ (void) FormatLocaleString(geometry,MaxTextExtent,"%gx%g!", primitive_info[1].point.x,primitive_info[1].point.y); composite_image->filter=image->filter; (void) TransformImage(&composite_image,(char *) NULL,geometry); } if (composite_image->matte == MagickFalse) (void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel); if (draw_info->opacity != OpaqueOpacity) (void) SetImageOpacity(composite_image,draw_info->opacity); SetGeometry(image,&geometry); image->gravity=draw_info->gravity; geometry.x=x; geometry.y=y; (void) FormatLocaleString(composite_geometry,MaxTextExtent, "%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,(double) composite_image->rows,(double) geometry.x,(double) geometry.y); (void) ParseGravityGeometry(image,composite_geometry,&geometry, &image->exception); affine=draw_info->affine; affine.tx=(double) geometry.x; affine.ty=(double) geometry.y; composite_image->interpolate=image->interpolate; if (draw_info->compose == OverCompositeOp) (void) DrawAffineImage(image,composite_image,&affine); else (void) CompositeImage(image,draw_info->compose,composite_image, geometry.x,geometry.y); composite_image=DestroyImage(composite_image); break; } default: { double mid, scale; DrawInfo *clone_info; if (IsEventLogging() != MagickFalse) LogPrimitiveInfo(primitive_info); scale=ExpandAffine(&draw_info->affine); if ((draw_info->dash_pattern != (double *) NULL) && (fabs(draw_info->dash_pattern[0]) >= DrawEpsilon) && (fabs(scale*draw_info->stroke_width) >= DrawEpsilon) && (draw_info->stroke.opacity != (Quantum) TransparentOpacity)) { /* Draw dash polygon. */ clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); clone_info->stroke_width=0.0; clone_info->stroke.opacity=(Quantum) TransparentOpacity; status&=DrawPolygonPrimitive(image,clone_info,primitive_info); clone_info=DestroyDrawInfo(clone_info); (void) DrawDashPolygon(draw_info,primitive_info,image); break; } mid=ExpandAffine(&draw_info->affine)*draw_info->stroke_width/2.0; if ((mid > 1.0) && ((draw_info->stroke.opacity != (Quantum) TransparentOpacity) || (draw_info->stroke_pattern != (Image *) NULL))) { MagickBooleanType closed_path; /* Draw strokes while respecting line cap/join attributes. */ for (i=0; primitive_info[i].primitive != UndefinedPrimitive; i++) ; closed_path= (primitive_info[i-1].point.x == primitive_info[0].point.x) && (primitive_info[i-1].point.y == primitive_info[0].point.y) ? MagickTrue : MagickFalse; i=(ssize_t) primitive_info[0].coordinates; i=(ssize_t) primitive_info[0].coordinates; if (((closed_path != MagickFalse) && (draw_info->linejoin == RoundJoin)) || (primitive_info[i].primitive != UndefinedPrimitive)) { (void) DrawPolygonPrimitive(image,draw_info,primitive_info); break; } if (draw_info->linecap == RoundCap) { (void) DrawPolygonPrimitive(image,draw_info,primitive_info); break; } clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); clone_info->stroke_width=0.0; clone_info->stroke.opacity=(Quantum) TransparentOpacity; status&=DrawPolygonPrimitive(image,clone_info,primitive_info); clone_info=DestroyDrawInfo(clone_info); status&=DrawStrokePolygon(image,draw_info,primitive_info); break; } status&=DrawPolygonPrimitive(image,draw_info,primitive_info); break; } } image_view=DestroyCacheView(image_view); if (image->debug != MagickFalse) (void) LogMagickEvent(DrawEvent,GetMagickModule()," end draw-primitive"); return(status != 0 ? MagickTrue : MagickFalse); }
MagickExport MagickBooleanType DrawPrimitive(Image *image, const DrawInfo *draw_info,const PrimitiveInfo *primitive_info) { CacheView *image_view; ExceptionInfo *exception; MagickStatusType status; register ssize_t i, x; ssize_t y; if (image->debug != MagickFalse) { (void) LogMagickEvent(DrawEvent,GetMagickModule(), " begin draw-primitive"); (void) LogMagickEvent(DrawEvent,GetMagickModule(), " affine: %g,%g,%g,%g,%g,%g",draw_info->affine.sx, draw_info->affine.rx,draw_info->affine.ry,draw_info->affine.sy, draw_info->affine.tx,draw_info->affine.ty); } exception=(&image->exception); if ((IsGrayColorspace(image->colorspace) != MagickFalse) && ((IsPixelGray(&draw_info->fill) == MagickFalse) || (IsPixelGray(&draw_info->stroke) == MagickFalse))) (void) SetImageColorspace(image,sRGBColorspace); status=MagickTrue; x=(ssize_t) ceil(primitive_info->point.x-0.5); y=(ssize_t) ceil(primitive_info->point.y-0.5); image_view=AcquireAuthenticCacheView(image,exception); switch (primitive_info->primitive) { case PointPrimitive: { PixelPacket fill_color; PixelPacket *q; if ((y < 0) || (y >= (ssize_t) image->rows)) break; if ((x < 0) || (x >= (ssize_t) image->columns)) break; q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,exception); if (q == (PixelPacket *) NULL) break; (void) GetFillColor(draw_info,x,y,&fill_color); MagickCompositeOver(&fill_color,(MagickRealType) fill_color.opacity,q, (MagickRealType) q->opacity,q); status&=SyncCacheViewAuthenticPixels(image_view,exception); break; } case ColorPrimitive: { switch (primitive_info->method) { case PointMethod: default: { PixelPacket *q; q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,exception); if (q == (PixelPacket *) NULL) break; (void) GetFillColor(draw_info,x,y,q); status&=SyncCacheViewAuthenticPixels(image_view,exception); break; } case ReplaceMethod: { MagickBooleanType sync; PixelPacket target; status&=GetOneCacheViewVirtualPixel(image_view,x,y,&target,exception); for (y=0; y < (ssize_t) image->rows; y++) { register PixelPacket *magick_restrict q; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1, exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { if (IsColorSimilar(image,q,&target) == MagickFalse) { q++; continue; } (void) GetFillColor(draw_info,x,y,q); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) break; } break; } case FloodfillMethod: case FillToBorderMethod: { MagickPixelPacket target; (void) GetOneVirtualMagickPixel(image,x,y,&target,exception); if (primitive_info->method == FillToBorderMethod) { target.red=(MagickRealType) draw_info->border_color.red; target.green=(MagickRealType) draw_info->border_color.green; target.blue=(MagickRealType) draw_info->border_color.blue; } status&=FloodfillPaintImage(image,DefaultChannels,draw_info,&target,x, y,primitive_info->method == FloodfillMethod ? MagickFalse : MagickTrue); break; } case ResetMethod: { MagickBooleanType sync; for (y=0; y < (ssize_t) image->rows; y++) { register PixelPacket *magick_restrict q; register ssize_t x; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1, exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { (void) GetFillColor(draw_info,x,y,q); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) break; } break; } } break; } case MattePrimitive: { if (image->matte == MagickFalse) (void) SetImageAlphaChannel(image,OpaqueAlphaChannel); switch (primitive_info->method) { case PointMethod: default: { PixelPacket pixel; PixelPacket *q; q=GetCacheViewAuthenticPixels(image_view,x,y,1,1,exception); if (q == (PixelPacket *) NULL) break; (void) GetFillColor(draw_info,x,y,&pixel); SetPixelOpacity(q,pixel.opacity); status&=SyncCacheViewAuthenticPixels(image_view,exception); break; } case ReplaceMethod: { MagickBooleanType sync; PixelPacket pixel, target; status&=GetOneCacheViewVirtualPixel(image_view,x,y,&target,exception); for (y=0; y < (ssize_t) image->rows; y++) { register PixelPacket *magick_restrict q; register ssize_t x; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1, exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { if (IsColorSimilar(image,q,&target) == MagickFalse) { q++; continue; } (void) GetFillColor(draw_info,x,y,&pixel); SetPixelOpacity(q,pixel.opacity); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) break; } break; } case FloodfillMethod: case FillToBorderMethod: { MagickPixelPacket target; (void) GetOneVirtualMagickPixel(image,x,y,&target,exception); if (primitive_info->method == FillToBorderMethod) { target.red=(MagickRealType) draw_info->border_color.red; target.green=(MagickRealType) draw_info->border_color.green; target.blue=(MagickRealType) draw_info->border_color.blue; } status&=FloodfillPaintImage(image,OpacityChannel,draw_info,&target,x, y,primitive_info->method == FloodfillMethod ? MagickFalse : MagickTrue); break; } case ResetMethod: { MagickBooleanType sync; PixelPacket pixel; for (y=0; y < (ssize_t) image->rows; y++) { register PixelPacket *magick_restrict q; register ssize_t x; q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1, exception); if (q == (PixelPacket *) NULL) break; for (x=0; x < (ssize_t) image->columns; x++) { (void) GetFillColor(draw_info,x,y,&pixel); SetPixelOpacity(q,pixel.opacity); q++; } sync=SyncCacheViewAuthenticPixels(image_view,exception); if (sync == MagickFalse) break; } break; } } break; } case TextPrimitive: { char geometry[MaxTextExtent]; DrawInfo *clone_info; if (primitive_info->text == (char *) NULL) break; clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); (void) CloneString(&clone_info->text,primitive_info->text); (void) FormatLocaleString(geometry,MaxTextExtent,"%+f%+f", primitive_info->point.x,primitive_info->point.y); (void) CloneString(&clone_info->geometry,geometry); status&=AnnotateImage(image,clone_info); clone_info=DestroyDrawInfo(clone_info); break; } case ImagePrimitive: { AffineMatrix affine; char composite_geometry[MaxTextExtent]; Image *composite_image; ImageInfo *clone_info; RectangleInfo geometry; ssize_t x1, y1; if (primitive_info->text == (char *) NULL) break; clone_info=AcquireImageInfo(); if (LocaleNCompare(primitive_info->text,"data:",5) == 0) composite_image=ReadInlineImage(clone_info,primitive_info->text, &image->exception); else { (void) CopyMagickString(clone_info->filename,primitive_info->text, MaxTextExtent); composite_image=ReadImage(clone_info,&image->exception); } clone_info=DestroyImageInfo(clone_info); if (composite_image == (Image *) NULL) break; (void) SetImageProgressMonitor(composite_image,(MagickProgressMonitor) NULL,(void *) NULL); x1=(ssize_t) ceil(primitive_info[1].point.x-0.5); y1=(ssize_t) ceil(primitive_info[1].point.y-0.5); if (((x1 != 0L) && (x1 != (ssize_t) composite_image->columns)) || ((y1 != 0L) && (y1 != (ssize_t) composite_image->rows))) { char geometry[MaxTextExtent]; /* Resize image. */ (void) FormatLocaleString(geometry,MaxTextExtent,"%gx%g!", primitive_info[1].point.x,primitive_info[1].point.y); composite_image->filter=image->filter; (void) TransformImage(&composite_image,(char *) NULL,geometry); } if (composite_image->matte == MagickFalse) (void) SetImageAlphaChannel(composite_image,OpaqueAlphaChannel); if (draw_info->opacity != OpaqueOpacity) (void) SetImageOpacity(composite_image,draw_info->opacity); SetGeometry(image,&geometry); image->gravity=draw_info->gravity; geometry.x=x; geometry.y=y; (void) FormatLocaleString(composite_geometry,MaxTextExtent, "%.20gx%.20g%+.20g%+.20g",(double) composite_image->columns,(double) composite_image->rows,(double) geometry.x,(double) geometry.y); (void) ParseGravityGeometry(image,composite_geometry,&geometry, &image->exception); affine=draw_info->affine; affine.tx=(double) geometry.x; affine.ty=(double) geometry.y; composite_image->interpolate=image->interpolate; if (draw_info->compose == OverCompositeOp) (void) DrawAffineImage(image,composite_image,&affine); else (void) CompositeImage(image,draw_info->compose,composite_image, geometry.x,geometry.y); composite_image=DestroyImage(composite_image); break; } default: { double mid, scale; DrawInfo *clone_info; if (IsEventLogging() != MagickFalse) LogPrimitiveInfo(primitive_info); scale=ExpandAffine(&draw_info->affine); if ((draw_info->dash_pattern != (double *) NULL) && (fabs(draw_info->dash_pattern[0]) >= DrawEpsilon) && (fabs(scale*draw_info->stroke_width) >= DrawEpsilon) && (draw_info->stroke.opacity != (Quantum) TransparentOpacity)) { /* Draw dash polygon. */ clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); clone_info->stroke_width=0.0; clone_info->stroke.opacity=(Quantum) TransparentOpacity; status&=DrawPolygonPrimitive(image,clone_info,primitive_info); clone_info=DestroyDrawInfo(clone_info); (void) DrawDashPolygon(draw_info,primitive_info,image); break; } mid=ExpandAffine(&draw_info->affine)*draw_info->stroke_width/2.0; if ((mid > 1.0) && ((draw_info->stroke.opacity != (Quantum) TransparentOpacity) || (draw_info->stroke_pattern != (Image *) NULL))) { MagickBooleanType closed_path; /* Draw strokes while respecting line cap/join attributes. */ for (i=0; primitive_info[i].primitive != UndefinedPrimitive; i++) ; closed_path= (primitive_info[i-1].point.x == primitive_info[0].point.x) && (primitive_info[i-1].point.y == primitive_info[0].point.y) ? MagickTrue : MagickFalse; i=(ssize_t) primitive_info[0].coordinates; i=(ssize_t) primitive_info[0].coordinates; if (((closed_path != MagickFalse) && (draw_info->linejoin == RoundJoin)) || (primitive_info[i].primitive != UndefinedPrimitive)) { (void) DrawPolygonPrimitive(image,draw_info,primitive_info); break; } if (draw_info->linecap == RoundCap) { (void) DrawPolygonPrimitive(image,draw_info,primitive_info); break; } clone_info=CloneDrawInfo((ImageInfo *) NULL,draw_info); clone_info->stroke_width=0.0; clone_info->stroke.opacity=(Quantum) TransparentOpacity; status&=DrawPolygonPrimitive(image,clone_info,primitive_info); clone_info=DestroyDrawInfo(clone_info); status&=DrawStrokePolygon(image,draw_info,primitive_info); break; } status&=DrawPolygonPrimitive(image,draw_info,primitive_info); break; } } image_view=DestroyCacheView(image_view); if (image->debug != MagickFalse) (void) LogMagickEvent(DrawEvent,GetMagickModule()," end draw-primitive"); return(status != 0 ? MagickTrue : MagickFalse); }
C
ImageMagick
0
CVE-2017-5592
https://www.cvedetails.com/cve/CVE-2017-5592/
CWE-346
https://github.com/boothj5/profanity/commit/8e75437a7e43d4c55e861691f74892e666e29b0b
8e75437a7e43d4c55e861691f74892e666e29b0b
Add carbons from check
_handle_error(xmpp_stanza_t *const stanza) { const char *id = xmpp_stanza_get_id(stanza); const char *jid = xmpp_stanza_get_from(stanza); xmpp_stanza_t *error_stanza = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_ERROR); const char *type = NULL; if (error_stanza) { type = xmpp_stanza_get_type(error_stanza); } char *err_msg = stanza_get_error_message(stanza); GString *log_msg = g_string_new("message stanza error received"); if (id) { g_string_append(log_msg, " id="); g_string_append(log_msg, id); } if (jid) { g_string_append(log_msg, " from="); g_string_append(log_msg, jid); } if (type) { g_string_append(log_msg, " type="); g_string_append(log_msg, type); } g_string_append(log_msg, " error="); g_string_append(log_msg, err_msg); log_info(log_msg->str); g_string_free(log_msg, TRUE); if (!jid) { ui_handle_error(err_msg); } else if (type && (strcmp(type, "cancel") == 0)) { log_info("Recipient %s not found: %s", jid, err_msg); Jid *jidp = jid_create(jid); chat_session_remove(jidp->barejid); jid_destroy(jidp); } else { ui_handle_recipient_error(jid, err_msg); } free(err_msg); }
_handle_error(xmpp_stanza_t *const stanza) { const char *id = xmpp_stanza_get_id(stanza); const char *jid = xmpp_stanza_get_from(stanza); xmpp_stanza_t *error_stanza = xmpp_stanza_get_child_by_name(stanza, STANZA_NAME_ERROR); const char *type = NULL; if (error_stanza) { type = xmpp_stanza_get_type(error_stanza); } char *err_msg = stanza_get_error_message(stanza); GString *log_msg = g_string_new("message stanza error received"); if (id) { g_string_append(log_msg, " id="); g_string_append(log_msg, id); } if (jid) { g_string_append(log_msg, " from="); g_string_append(log_msg, jid); } if (type) { g_string_append(log_msg, " type="); g_string_append(log_msg, type); } g_string_append(log_msg, " error="); g_string_append(log_msg, err_msg); log_info(log_msg->str); g_string_free(log_msg, TRUE); if (!jid) { ui_handle_error(err_msg); } else if (type && (strcmp(type, "cancel") == 0)) { log_info("Recipient %s not found: %s", jid, err_msg); Jid *jidp = jid_create(jid); chat_session_remove(jidp->barejid); jid_destroy(jidp); } else { ui_handle_recipient_error(jid, err_msg); } free(err_msg); }
C
profanity
0
CVE-2018-6117
https://www.cvedetails.com/cve/CVE-2018-6117/
CWE-200
https://github.com/chromium/chromium/commit/52f6eb4221430b6248fd5a59bec53bfef9fdd9a7
52f6eb4221430b6248fd5a59bec53bfef9fdd9a7
[md-settings] Clarify Password Saving and Autofill Toggles This change clarifies the wording around the password saving and autofill toggles. Bug: 822465 Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation Change-Id: I91b31fe61cd0754239f7908e8c04c7e69b72f670 Reviewed-on: https://chromium-review.googlesource.com/970541 Commit-Queue: Jan Wilken Dörrie <[email protected]> Reviewed-by: Vaclav Brozek <[email protected]> Reviewed-by: Jochen Eisinger <[email protected]> Cr-Commit-Position: refs/heads/master@{#544661}
void AddLanguagesStrings(content::WebUIDataSource* html_source) { LocalizedString localized_strings[] = { {"languagesPageTitle", IDS_SETTINGS_LANGUAGES_PAGE_TITLE}, {"languagesListTitle", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_TITLE}, {"languagesExpandA11yLabel", IDS_SETTINGS_LANGUAGES_EXPAND_ACCESSIBILITY_LABEL}, {"orderLanguagesInstructions", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_ORDERING_INSTRUCTIONS}, {"moveToTop", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_MOVE_TO_TOP}, {"moveUp", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_MOVE_UP}, {"moveDown", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_MOVE_DOWN}, {"removeLanguage", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_REMOVE}, {"addLanguages", IDS_SETTINGS_LANGUAGES_LANGUAGES_ADD}, #if defined(OS_CHROMEOS) {"inputMethodsListTitle", IDS_SETTINGS_LANGUAGES_INPUT_METHODS_LIST_TITLE}, {"inputMethodEnabled", IDS_SETTINGS_LANGUAGES_INPUT_METHOD_ENABLED}, {"inputMethodsExpandA11yLabel", IDS_SETTINGS_LANGUAGES_INPUT_METHODS_EXPAND_ACCESSIBILITY_LABEL}, {"manageInputMethods", IDS_SETTINGS_LANGUAGES_INPUT_METHODS_MANAGE}, {"manageInputMethodsPageTitle", IDS_SETTINGS_LANGUAGES_MANAGE_INPUT_METHODS_TITLE}, {"showImeMenu", IDS_SETTINGS_LANGUAGES_SHOW_IME_MENU}, #endif {"addLanguagesDialogTitle", IDS_SETTINGS_LANGUAGES_MANAGE_LANGUAGES_TITLE}, {"allLanguages", IDS_SETTINGS_LANGUAGES_ALL_LANGUAGES}, {"enabledLanguages", IDS_SETTINGS_LANGUAGES_ENABLED_LANGUAGES}, {"isDisplayedInThisLanguage", IDS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE}, {"displayInThisLanguage", IDS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE}, {"offerToTranslateInThisLanguage", IDS_SETTINGS_LANGUAGES_OFFER_TO_TRANSLATE_IN_THIS_LANGUAGE}, {"offerToEnableTranslate", IDS_SETTINGS_LANGUAGES_OFFER_TO_ENABLE_TRANSLATE}, #if !defined(OS_MACOSX) {"spellCheckListTitle", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_LIST_TITLE}, {"spellCheckExpandA11yLabel", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_EXPAND_ACCESSIBILITY_LABEL}, {"spellCheckSummaryTwoLanguages", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_SUMMARY_TWO_LANGUAGES}, {"spellCheckSummaryThreeLanguages", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_SUMMARY_THREE_LANGUAGES}, {"spellCheckSummaryMultipleLanguages", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_SUMMARY_MULTIPLE_LANGUAGES}, {"manageSpellCheck", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_MANAGE}, {"editDictionaryPageTitle", IDS_SETTINGS_LANGUAGES_EDIT_DICTIONARY_TITLE}, {"addDictionaryWordLabel", IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD}, {"addDictionaryWordButton", IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD_BUTTON}, {"addDictionaryWordDuplicateError", IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD_DUPLICATE_ERROR}, {"addDictionaryWordLengthError", IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD_LENGTH_ERROR}, {"customDictionaryWords", IDS_SETTINGS_LANGUAGES_DICTIONARY_WORDS}, {"noCustomDictionaryWordsFound", IDS_SETTINGS_LANGUAGES_DICTIONARY_WORDS_NONE}, {"spellCheckDisabled", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_DISABLED}, #endif }; AddLocalizedStringsBulk(html_source, localized_strings, arraysize(localized_strings)); #if defined(OS_CHROMEOS) html_source->AddString( "languagesLearnMoreURL", base::ASCIIToUTF16(chrome::kLanguageSettingsLearnMoreUrl)); #endif }
void AddLanguagesStrings(content::WebUIDataSource* html_source) { LocalizedString localized_strings[] = { {"languagesPageTitle", IDS_SETTINGS_LANGUAGES_PAGE_TITLE}, {"languagesListTitle", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_TITLE}, {"languagesExpandA11yLabel", IDS_SETTINGS_LANGUAGES_EXPAND_ACCESSIBILITY_LABEL}, {"orderLanguagesInstructions", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_ORDERING_INSTRUCTIONS}, {"moveToTop", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_MOVE_TO_TOP}, {"moveUp", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_MOVE_UP}, {"moveDown", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_MOVE_DOWN}, {"removeLanguage", IDS_SETTINGS_LANGUAGES_LANGUAGES_LIST_REMOVE}, {"addLanguages", IDS_SETTINGS_LANGUAGES_LANGUAGES_ADD}, #if defined(OS_CHROMEOS) {"inputMethodsListTitle", IDS_SETTINGS_LANGUAGES_INPUT_METHODS_LIST_TITLE}, {"inputMethodEnabled", IDS_SETTINGS_LANGUAGES_INPUT_METHOD_ENABLED}, {"inputMethodsExpandA11yLabel", IDS_SETTINGS_LANGUAGES_INPUT_METHODS_EXPAND_ACCESSIBILITY_LABEL}, {"manageInputMethods", IDS_SETTINGS_LANGUAGES_INPUT_METHODS_MANAGE}, {"manageInputMethodsPageTitle", IDS_SETTINGS_LANGUAGES_MANAGE_INPUT_METHODS_TITLE}, {"showImeMenu", IDS_SETTINGS_LANGUAGES_SHOW_IME_MENU}, #endif {"addLanguagesDialogTitle", IDS_SETTINGS_LANGUAGES_MANAGE_LANGUAGES_TITLE}, {"allLanguages", IDS_SETTINGS_LANGUAGES_ALL_LANGUAGES}, {"enabledLanguages", IDS_SETTINGS_LANGUAGES_ENABLED_LANGUAGES}, {"isDisplayedInThisLanguage", IDS_SETTINGS_LANGUAGES_IS_DISPLAYED_IN_THIS_LANGUAGE}, {"displayInThisLanguage", IDS_SETTINGS_LANGUAGES_DISPLAY_IN_THIS_LANGUAGE}, {"offerToTranslateInThisLanguage", IDS_SETTINGS_LANGUAGES_OFFER_TO_TRANSLATE_IN_THIS_LANGUAGE}, {"offerToEnableTranslate", IDS_SETTINGS_LANGUAGES_OFFER_TO_ENABLE_TRANSLATE}, #if !defined(OS_MACOSX) {"spellCheckListTitle", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_LIST_TITLE}, {"spellCheckExpandA11yLabel", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_EXPAND_ACCESSIBILITY_LABEL}, {"spellCheckSummaryTwoLanguages", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_SUMMARY_TWO_LANGUAGES}, {"spellCheckSummaryThreeLanguages", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_SUMMARY_THREE_LANGUAGES}, {"spellCheckSummaryMultipleLanguages", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_SUMMARY_MULTIPLE_LANGUAGES}, {"manageSpellCheck", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_MANAGE}, {"editDictionaryPageTitle", IDS_SETTINGS_LANGUAGES_EDIT_DICTIONARY_TITLE}, {"addDictionaryWordLabel", IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD}, {"addDictionaryWordButton", IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD_BUTTON}, {"addDictionaryWordDuplicateError", IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD_DUPLICATE_ERROR}, {"addDictionaryWordLengthError", IDS_SETTINGS_LANGUAGES_ADD_DICTIONARY_WORD_LENGTH_ERROR}, {"customDictionaryWords", IDS_SETTINGS_LANGUAGES_DICTIONARY_WORDS}, {"noCustomDictionaryWordsFound", IDS_SETTINGS_LANGUAGES_DICTIONARY_WORDS_NONE}, {"spellCheckDisabled", IDS_SETTINGS_LANGUAGES_SPELL_CHECK_DISABLED}, #endif }; AddLocalizedStringsBulk(html_source, localized_strings, arraysize(localized_strings)); #if defined(OS_CHROMEOS) html_source->AddString( "languagesLearnMoreURL", base::ASCIIToUTF16(chrome::kLanguageSettingsLearnMoreUrl)); #endif }
C
Chrome
0
CVE-2013-7271
https://www.cvedetails.com/cve/CVE-2013-7271/
CWE-20
https://github.com/torvalds/linux/commit/f3d3342602f8bcbf37d7c46641cb9bca7618eb1c
f3d3342602f8bcbf37d7c46641cb9bca7618eb1c
net: rework recvmsg handler msg_name and msg_namelen logic This patch now always passes msg->msg_namelen as 0. recvmsg handlers must set msg_namelen to the proper size <= sizeof(struct sockaddr_storage) to return msg_name to the user. This prevents numerous uninitialized memory leaks we had in the recvmsg handlers and makes it harder for new code to accidentally leak uninitialized memory. Optimize for the case recvfrom is called with NULL as address. We don't need to copy the address at all, so set it to NULL before invoking the recvmsg handler. We can do so, because all the recvmsg handlers must cope with the case a plain read() is called on them. read() also sets msg_name to NULL. Also document these changes in include/linux/net.h as suggested by David Miller. Changes since RFC: Set msg->msg_name = NULL if user specified a NULL in msg_name but had a non-null msg_namelen in verify_iovec/verify_compat_iovec. This doesn't affect sendto as it would bail out earlier while trying to copy-in the address. It also more naturally reflects the logic by the callers of verify_iovec. With this change in place I could remove " if (!uaddr || msg_sys->msg_namelen == 0) msg->msg_name = NULL ". This change does not alter the user visible error logic as we ignore msg_namelen as long as msg_name is NULL. Also remove two unnecessary curly brackets in ___sys_recvmsg and change comments to netdev style. Cc: David Miller <[email protected]> Suggested-by: Eric Dumazet <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: David S. Miller <[email protected]>
int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc **d) { struct sock *sk, *parent; bdaddr_t src, dst; int result = 0; BT_DBG("session %p channel %d", s, channel); rfcomm_session_getaddr(s, &src, &dst); /* Check if we have socket listening on channel */ parent = rfcomm_get_sock_by_channel(BT_LISTEN, channel, &src); if (!parent) return 0; bh_lock_sock(parent); /* Check for backlog size */ if (sk_acceptq_is_full(parent)) { BT_DBG("backlog full %d", parent->sk_ack_backlog); goto done; } sk = rfcomm_sock_alloc(sock_net(parent), NULL, BTPROTO_RFCOMM, GFP_ATOMIC); if (!sk) goto done; bt_sock_reclassify_lock(sk, BTPROTO_RFCOMM); rfcomm_sock_init(sk, parent); bacpy(&rfcomm_pi(sk)->src, &src); bacpy(&rfcomm_pi(sk)->dst, &dst); rfcomm_pi(sk)->channel = channel; sk->sk_state = BT_CONFIG; bt_accept_enqueue(parent, sk); /* Accept connection and return socket DLC */ *d = rfcomm_pi(sk)->dlc; result = 1; done: bh_unlock_sock(parent); if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) parent->sk_state_change(parent); return result; }
int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc **d) { struct sock *sk, *parent; bdaddr_t src, dst; int result = 0; BT_DBG("session %p channel %d", s, channel); rfcomm_session_getaddr(s, &src, &dst); /* Check if we have socket listening on channel */ parent = rfcomm_get_sock_by_channel(BT_LISTEN, channel, &src); if (!parent) return 0; bh_lock_sock(parent); /* Check for backlog size */ if (sk_acceptq_is_full(parent)) { BT_DBG("backlog full %d", parent->sk_ack_backlog); goto done; } sk = rfcomm_sock_alloc(sock_net(parent), NULL, BTPROTO_RFCOMM, GFP_ATOMIC); if (!sk) goto done; bt_sock_reclassify_lock(sk, BTPROTO_RFCOMM); rfcomm_sock_init(sk, parent); bacpy(&rfcomm_pi(sk)->src, &src); bacpy(&rfcomm_pi(sk)->dst, &dst); rfcomm_pi(sk)->channel = channel; sk->sk_state = BT_CONFIG; bt_accept_enqueue(parent, sk); /* Accept connection and return socket DLC */ *d = rfcomm_pi(sk)->dlc; result = 1; done: bh_unlock_sock(parent); if (test_bit(BT_SK_DEFER_SETUP, &bt_sk(parent)->flags)) parent->sk_state_change(parent); return result; }
C
linux
0
CVE-2019-5755
https://www.cvedetails.com/cve/CVE-2019-5755/
CWE-189
https://github.com/chromium/chromium/commit/971548cdca2d4c0a6fedd3db0c94372c2a27eac3
971548cdca2d4c0a6fedd3db0c94372c2a27eac3
Make MediaStreamDispatcherHost per-request instead of per-frame. Instead of having RenderFrameHost own a single MSDH to handle all requests from a frame, MSDH objects will be owned by a strong binding. A consequence of this is that an additional requester ID is added to requests to MediaStreamManager, so that an MSDH is able to cancel only requests generated by it. In practice, MSDH will continue to be per frame in most cases since each frame normally makes a single request for an MSDH object. This fixes a lifetime issue caused by the IO thread executing tasks after the RenderFrameHost dies. Drive-by: Fix some minor lint issues. Bug: 912520 Change-Id: I52742ffc98b9fc57ce8e6f5093a61aed86d3e516 Reviewed-on: https://chromium-review.googlesource.com/c/1369799 Reviewed-by: Emircan Uysaler <[email protected]> Reviewed-by: Ken Buchanan <[email protected]> Reviewed-by: Olga Sharonova <[email protected]> Commit-Queue: Guido Urdaneta <[email protected]> Cr-Commit-Position: refs/heads/master@{#616347}
SpeechRecognitionManagerImpl::Session::Session() : id(kSessionIDInvalid), abort_requested(false) {}
SpeechRecognitionManagerImpl::Session::Session() : id(kSessionIDInvalid), abort_requested(false) {}
C
Chrome
0
CVE-2016-4951
https://www.cvedetails.com/cve/CVE-2016-4951/
null
https://github.com/torvalds/linux/commit/45e093ae2830cd1264677d47ff9a95a71f5d9f9c
45e093ae2830cd1264677d47ff9a95a71f5d9f9c
tipc: check nl sock before parsing nested attributes Make sure the socket for which the user is listing publication exists before parsing the socket netlink attributes. Prior to this patch a call without any socket caused a NULL pointer dereference in tipc_nl_publ_dump(). Tested-and-reported-by: Baozeng Ding <[email protected]> Signed-off-by: Richard Alpe <[email protected]> Acked-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static int tipc_listen(struct socket *sock, int len) { struct sock *sk = sock->sk; int res; lock_sock(sk); if (sock->state != SS_UNCONNECTED) res = -EINVAL; else { sock->state = SS_LISTENING; res = 0; } release_sock(sk); return res; }
static int tipc_listen(struct socket *sock, int len) { struct sock *sk = sock->sk; int res; lock_sock(sk); if (sock->state != SS_UNCONNECTED) res = -EINVAL; else { sock->state = SS_LISTENING; res = 0; } release_sock(sk); return res; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/790613cb3725005dda8f7fbfaa344a9e99a8f2a8
790613cb3725005dda8f7fbfaa344a9e99a8f2a8
Replaces the % character with \x when generating Windows shortcuts via File->"Create application shortcuts." The \x is converted back to % in handling the --app switch. BUG=23693 TEST=None Review URL: http://codereview.chromium.org/515028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35377 0039d316-1c4b-4281-b951-d872f2087c98
virtual bool ShouldExpire( const NavigationController::LoadCommittedDetails& details) const { return should_expire_; }
virtual bool ShouldExpire( const NavigationController::LoadCommittedDetails& details) const { return should_expire_; }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/2bcaf4649c1d495072967ea454e8c16dce044705
2bcaf4649c1d495072967ea454e8c16dce044705
Don't interpret embeded NULLs in a response header line as a line terminator. BUG=95992 Review URL: http://codereview.chromium.org/7796025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@100863 0039d316-1c4b-4281-b951-d872f2087c98
void HttpResponseHeaders::Parse(const std::string& raw_input) { raw_headers_.reserve(raw_input.size()); std::string::const_iterator line_begin = raw_input.begin(); std::string::const_iterator line_end = std::find(line_begin, raw_input.end(), '\0'); bool has_headers = (line_end != raw_input.end() && (line_end + 1) != raw_input.end() && *(line_end + 1) != '\0'); ParseStatusLine(line_begin, line_end, has_headers); if (line_end == raw_input.end()) { raw_headers_.push_back('\0'); return; } size_t status_line_len = raw_headers_.size(); raw_headers_.append(line_end + 1, raw_input.end()); line_end = raw_headers_.begin() + status_line_len - 1; HttpUtil::HeadersIterator headers(line_end + 1, raw_headers_.end(), std::string(1, '\0')); while (headers.GetNext()) { AddHeader(headers.name_begin(), headers.name_end(), headers.values_begin(), headers.values_end()); } }
void HttpResponseHeaders::Parse(const std::string& raw_input) { raw_headers_.reserve(raw_input.size()); std::string::const_iterator line_begin = raw_input.begin(); std::string::const_iterator line_end = std::find(line_begin, raw_input.end(), '\0'); bool has_headers = (line_end != raw_input.end() && (line_end + 1) != raw_input.end() && *(line_end + 1) != '\0'); ParseStatusLine(line_begin, line_end, has_headers); if (line_end == raw_input.end()) { raw_headers_.push_back('\0'); return; } size_t status_line_len = raw_headers_.size(); raw_headers_.append(line_end + 1, raw_input.end()); line_end = raw_headers_.begin() + status_line_len - 1; HttpUtil::HeadersIterator headers(line_end + 1, raw_headers_.end(), std::string(1, '\0')); while (headers.GetNext()) { AddHeader(headers.name_begin(), headers.name_end(), headers.values_begin(), headers.values_end()); } }
C
Chrome
0
CVE-2019-5787
https://www.cvedetails.com/cve/CVE-2019-5787/
CWE-416
https://github.com/chromium/chromium/commit/6a7063ae61cf031630b48bdcdb09863ffc199962
6a7063ae61cf031630b48bdcdb09863ffc199962
Clean up CanvasResourceDispatcher on finalizer We may have pending mojo messages after GC, so we want to drop the dispatcher as soon as possible. Bug: 929757,913964 Change-Id: I5789bcbb55aada4a74c67a28758f07686f8911c0 Reviewed-on: https://chromium-review.googlesource.com/c/1489175 Reviewed-by: Ken Rockot <[email protected]> Commit-Queue: Ken Rockot <[email protected]> Commit-Queue: Fernando Serboncini <[email protected]> Auto-Submit: Fernando Serboncini <[email protected]> Cr-Commit-Position: refs/heads/master@{#635833}
void OffscreenCanvas::Trace(blink::Visitor* visitor) { visitor->Trace(context_); visitor->Trace(execution_context_); EventTargetWithInlineData::Trace(visitor); }
void OffscreenCanvas::Trace(blink::Visitor* visitor) { visitor->Trace(context_); visitor->Trace(execution_context_); EventTargetWithInlineData::Trace(visitor); }
C
Chrome
0
CVE-2014-2889
https://www.cvedetails.com/cve/CVE-2014-2889/
CWE-189
https://github.com/torvalds/linux/commit/a03ffcf873fe0f2565386ca8ef832144c42e67fa
a03ffcf873fe0f2565386ca8ef832144c42e67fa
net: bpf_jit: fix an off-one bug in x86_64 cond jump target x86 jump instruction size is 2 or 5 bytes (near/long jump), not 2 or 6 bytes. In case a conditional jump is followed by a long jump, conditional jump target is one byte past the start of target instruction. Signed-off-by: Markus Kötter <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len) { if (len == 1) *ptr = bytes; else if (len == 2) *(u16 *)ptr = bytes; else { *(u32 *)ptr = bytes; barrier(); } return ptr + len; }
static inline u8 *emit_code(u8 *ptr, u32 bytes, unsigned int len) { if (len == 1) *ptr = bytes; else if (len == 2) *(u16 *)ptr = bytes; else { *(u32 *)ptr = bytes; barrier(); } return ptr + len; }
C
linux
0
CVE-2016-9389
https://www.cvedetails.com/cve/CVE-2016-9389/
null
https://github.com/mdadams/jasper/commit/dee11ec440d7908d1daf69f40a3324b27cf213ba
dee11ec440d7908d1daf69f40a3324b27cf213ba
The component domains must be the same for the ICT/RCT in the JPC codec. This was previously enforced with an assertion. Now, it is handled in a more graceful manner.
static int jpc_dec_tiledecode(jpc_dec_t *dec, jpc_dec_tile_t *tile) { int i; int j; jpc_dec_tcomp_t *tcomp; jpc_dec_rlvl_t *rlvl; jpc_dec_band_t *band; int compno; int rlvlno; int bandno; int adjust; int v; jpc_dec_ccp_t *ccp; jpc_dec_cmpt_t *cmpt; if (jpc_dec_decodecblks(dec, tile)) { jas_eprintf("jpc_dec_decodecblks failed\n"); return -1; } /* Perform dequantization. */ for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps; ++compno, ++tcomp) { ccp = &tile->cp->ccps[compno]; for (rlvlno = 0, rlvl = tcomp->rlvls; rlvlno < tcomp->numrlvls; ++rlvlno, ++rlvl) { if (!rlvl->bands) { continue; } for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands; ++bandno, ++band) { if (!band->data) { continue; } jpc_undo_roi(band->data, band->roishift, ccp->roishift - band->roishift, band->numbps); if (tile->realmode) { jas_matrix_asl(band->data, JPC_FIX_FRACBITS); jpc_dequantize(band->data, band->absstepsize); } } } } /* Apply an inverse wavelet transform if necessary. */ for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps; ++compno, ++tcomp) { ccp = &tile->cp->ccps[compno]; jpc_tsfb_synthesize(tcomp->tsfb, tcomp->data); } /* Apply an inverse intercomponent transform if necessary. */ switch (tile->cp->mctid) { case JPC_MCT_RCT: if (dec->numcomps < 3) { jas_eprintf("RCT requires at least three components\n"); return -1; } if (!jas_image_cmpt_domains_same(dec->image)) { jas_eprintf("RCT requires all components have the same domain\n"); return -1; } jpc_irct(tile->tcomps[0].data, tile->tcomps[1].data, tile->tcomps[2].data); break; case JPC_MCT_ICT: if (dec->numcomps < 3) { jas_eprintf("ICT requires at least three components\n"); return -1; } if (!jas_image_cmpt_domains_same(dec->image)) { jas_eprintf("RCT requires all components have the same domain\n"); return -1; } jpc_iict(tile->tcomps[0].data, tile->tcomps[1].data, tile->tcomps[2].data); break; } /* Perform rounding and convert to integer values. */ if (tile->realmode) { for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps; ++compno, ++tcomp) { for (i = 0; i < jas_matrix_numrows(tcomp->data); ++i) { for (j = 0; j < jas_matrix_numcols(tcomp->data); ++j) { v = jas_matrix_get(tcomp->data, i, j); v = jpc_fix_round(v); jas_matrix_set(tcomp->data, i, j, jpc_fixtoint(v)); } } } } /* Perform level shift. */ for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno < dec->numcomps; ++compno, ++tcomp, ++cmpt) { adjust = cmpt->sgnd ? 0 : (1 << (cmpt->prec - 1)); for (i = 0; i < jas_matrix_numrows(tcomp->data); ++i) { for (j = 0; j < jas_matrix_numcols(tcomp->data); ++j) { *jas_matrix_getref(tcomp->data, i, j) += adjust; } } } /* Perform clipping. */ for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno < dec->numcomps; ++compno, ++tcomp, ++cmpt) { jpc_fix_t mn; jpc_fix_t mx; mn = cmpt->sgnd ? (-(1 << (cmpt->prec - 1))) : (0); mx = cmpt->sgnd ? ((1 << (cmpt->prec - 1)) - 1) : ((1 << cmpt->prec) - 1); jas_matrix_clip(tcomp->data, mn, mx); } /* XXX need to free tsfb struct */ /* Write the data for each component of the image. */ for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno < dec->numcomps; ++compno, ++tcomp, ++cmpt) { if (jas_image_writecmpt(dec->image, compno, tcomp->xstart - JPC_CEILDIV(dec->xstart, cmpt->hstep), tcomp->ystart - JPC_CEILDIV(dec->ystart, cmpt->vstep), jas_matrix_numcols( tcomp->data), jas_matrix_numrows(tcomp->data), tcomp->data)) { jas_eprintf("write component failed\n"); return -1; } } return 0; }
static int jpc_dec_tiledecode(jpc_dec_t *dec, jpc_dec_tile_t *tile) { int i; int j; jpc_dec_tcomp_t *tcomp; jpc_dec_rlvl_t *rlvl; jpc_dec_band_t *band; int compno; int rlvlno; int bandno; int adjust; int v; jpc_dec_ccp_t *ccp; jpc_dec_cmpt_t *cmpt; if (jpc_dec_decodecblks(dec, tile)) { jas_eprintf("jpc_dec_decodecblks failed\n"); return -1; } /* Perform dequantization. */ for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps; ++compno, ++tcomp) { ccp = &tile->cp->ccps[compno]; for (rlvlno = 0, rlvl = tcomp->rlvls; rlvlno < tcomp->numrlvls; ++rlvlno, ++rlvl) { if (!rlvl->bands) { continue; } for (bandno = 0, band = rlvl->bands; bandno < rlvl->numbands; ++bandno, ++band) { if (!band->data) { continue; } jpc_undo_roi(band->data, band->roishift, ccp->roishift - band->roishift, band->numbps); if (tile->realmode) { jas_matrix_asl(band->data, JPC_FIX_FRACBITS); jpc_dequantize(band->data, band->absstepsize); } } } } /* Apply an inverse wavelet transform if necessary. */ for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps; ++compno, ++tcomp) { ccp = &tile->cp->ccps[compno]; jpc_tsfb_synthesize(tcomp->tsfb, tcomp->data); } /* Apply an inverse intercomponent transform if necessary. */ switch (tile->cp->mctid) { case JPC_MCT_RCT: if (dec->numcomps < 3) { jas_eprintf("RCT requires at least three components\n"); return -1; } jpc_irct(tile->tcomps[0].data, tile->tcomps[1].data, tile->tcomps[2].data); break; case JPC_MCT_ICT: if (dec->numcomps < 3) { jas_eprintf("ICT requires at least three components\n"); return -1; } jpc_iict(tile->tcomps[0].data, tile->tcomps[1].data, tile->tcomps[2].data); break; } /* Perform rounding and convert to integer values. */ if (tile->realmode) { for (compno = 0, tcomp = tile->tcomps; compno < dec->numcomps; ++compno, ++tcomp) { for (i = 0; i < jas_matrix_numrows(tcomp->data); ++i) { for (j = 0; j < jas_matrix_numcols(tcomp->data); ++j) { v = jas_matrix_get(tcomp->data, i, j); v = jpc_fix_round(v); jas_matrix_set(tcomp->data, i, j, jpc_fixtoint(v)); } } } } /* Perform level shift. */ for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno < dec->numcomps; ++compno, ++tcomp, ++cmpt) { adjust = cmpt->sgnd ? 0 : (1 << (cmpt->prec - 1)); for (i = 0; i < jas_matrix_numrows(tcomp->data); ++i) { for (j = 0; j < jas_matrix_numcols(tcomp->data); ++j) { *jas_matrix_getref(tcomp->data, i, j) += adjust; } } } /* Perform clipping. */ for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno < dec->numcomps; ++compno, ++tcomp, ++cmpt) { jpc_fix_t mn; jpc_fix_t mx; mn = cmpt->sgnd ? (-(1 << (cmpt->prec - 1))) : (0); mx = cmpt->sgnd ? ((1 << (cmpt->prec - 1)) - 1) : ((1 << cmpt->prec) - 1); jas_matrix_clip(tcomp->data, mn, mx); } /* XXX need to free tsfb struct */ /* Write the data for each component of the image. */ for (compno = 0, tcomp = tile->tcomps, cmpt = dec->cmpts; compno < dec->numcomps; ++compno, ++tcomp, ++cmpt) { if (jas_image_writecmpt(dec->image, compno, tcomp->xstart - JPC_CEILDIV(dec->xstart, cmpt->hstep), tcomp->ystart - JPC_CEILDIV(dec->ystart, cmpt->vstep), jas_matrix_numcols( tcomp->data), jas_matrix_numrows(tcomp->data), tcomp->data)) { jas_eprintf("write component failed\n"); return -1; } } return 0; }
C
jasper
1
CVE-2013-7421
https://www.cvedetails.com/cve/CVE-2013-7421/
CWE-264
https://github.com/torvalds/linux/commit/5d26a105b5a73e5635eae0629b42fa0a90e07b7b
5d26a105b5a73e5635eae0629b42fa0a90e07b7b
crypto: prefix module autoloading with "crypto-" This prefixes all crypto module loading with "crypto-" so we never run the risk of exposing module auto-loading to userspace via a crypto API, as demonstrated by Mathias Krause: https://lkml.org/lkml/2013/3/4/70 Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
void ap_flush_queue(struct ap_device *ap_dev) { spin_lock_bh(&ap_dev->lock); __ap_flush_queue(ap_dev); spin_unlock_bh(&ap_dev->lock); }
void ap_flush_queue(struct ap_device *ap_dev) { spin_lock_bh(&ap_dev->lock); __ap_flush_queue(ap_dev); spin_unlock_bh(&ap_dev->lock); }
C
linux
0
CVE-2017-5019
https://www.cvedetails.com/cve/CVE-2017-5019/
CWE-416
https://github.com/chromium/chromium/commit/f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
f03ea5a5c2ff26e239dfd23e263b15da2d9cee93
Convert FrameHostMsg_DidAddMessageToConsole to Mojo. Note: Since this required changing the test RenderViewImplTest.DispatchBeforeUnloadCanDetachFrame, I manually re-introduced https://crbug.com/666714 locally (the bug the test was added for), and reran the test to confirm that it still covers the bug. Bug: 786836 Change-Id: I110668fa6f0f261fd2ac36bb91a8d8b31c99f4f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1526270 Commit-Queue: Lowell Manners <[email protected]> Reviewed-by: Daniel Cheng <[email protected]> Reviewed-by: Camille Lamy <[email protected]> Cr-Commit-Position: refs/heads/master@{#653137}
void RenderFrameHostImpl::OnRunJavaScriptDialog( const base::string16& message, const base::string16& default_prompt, JavaScriptDialogType dialog_type, IPC::Message* reply_msg) { if (IsWaitingForUnloadACK()) { SendJavaScriptDialogReply(reply_msg, true, base::string16()); return; } GetProcess()->SetBlocked(true); delegate_->RunJavaScriptDialog(this, message, default_prompt, dialog_type, reply_msg); }
void RenderFrameHostImpl::OnRunJavaScriptDialog( const base::string16& message, const base::string16& default_prompt, JavaScriptDialogType dialog_type, IPC::Message* reply_msg) { if (IsWaitingForUnloadACK()) { SendJavaScriptDialogReply(reply_msg, true, base::string16()); return; } GetProcess()->SetBlocked(true); delegate_->RunJavaScriptDialog(this, message, default_prompt, dialog_type, reply_msg); }
C
Chrome
0
CVE-2013-0892
https://www.cvedetails.com/cve/CVE-2013-0892/
null
https://github.com/chromium/chromium/commit/da5e5f78f02bc0af5ddc5694090defbef7853af1
da5e5f78f02bc0af5ddc5694090defbef7853af1
DevTools: remove references to modules/device_orientation from core BUG=340221 Review URL: https://codereview.chromium.org/150913003 git-svn-id: svn://svn.chromium.org/blink/trunk@166493 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void InspectorController::processGPUEvent(double timestamp, int phase, bool foreign, size_t usedGPUMemoryBytes) { if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspectorTimelineAgent()) timelineAgent->processGPUEvent(InspectorTimelineAgent::GPUEvent(timestamp, phase, foreign, usedGPUMemoryBytes)); }
void InspectorController::processGPUEvent(double timestamp, int phase, bool foreign, size_t usedGPUMemoryBytes) { if (InspectorTimelineAgent* timelineAgent = m_instrumentingAgents->inspectorTimelineAgent()) timelineAgent->processGPUEvent(InspectorTimelineAgent::GPUEvent(timestamp, phase, foreign, usedGPUMemoryBytes)); }
C
Chrome
0
CVE-2017-2583
https://www.cvedetails.com/cve/CVE-2017-2583/
null
https://github.com/torvalds/linux/commit/33ab91103b3415e12457e3104f0e4517ce12d0f3
33ab91103b3415e12457e3104f0e4517ce12d0f3
KVM: x86: fix emulation of "MOV SS, null selector" This is CVE-2017-2583. On Intel this causes a failed vmentry because SS's type is neither 3 nor 7 (even though the manual says this check is only done for usable SS, and the dmesg splat says that SS is unusable!). On AMD it's worse: svm.c is confused and sets CPL to 0 in the vmcb. The fix fabricates a data segment descriptor when SS is set to a null selector, so that CPL and SS.DPL are set correctly in the VMCS/vmcb. Furthermore, only allow setting SS to a NULL selector if SS.RPL < 3; this in turn ensures CPL < 3 because RPL must be equal to CPL. Thanks to Andy Lutomirski and Willy Tarreau for help in analyzing the bug and deciphering the manuals. Reported-by: Xiaohan Zhang <[email protected]> Fixes: 79d5b4c3cd809c770d4bf9812635647016c56011 Cc: [email protected] Signed-off-by: Paolo Bonzini <[email protected]>
static int segmented_write_std(struct x86_emulate_ctxt *ctxt, struct segmented_address addr, void *data, unsigned int size) { int rc; ulong linear; rc = linearize(ctxt, addr, size, true, &linear); if (rc != X86EMUL_CONTINUE) return rc; return ctxt->ops->write_std(ctxt, linear, data, size, &ctxt->exception); }
static int segmented_write_std(struct x86_emulate_ctxt *ctxt, struct segmented_address addr, void *data, unsigned int size) { int rc; ulong linear; rc = linearize(ctxt, addr, size, true, &linear); if (rc != X86EMUL_CONTINUE) return rc; return ctxt->ops->write_std(ctxt, linear, data, size, &ctxt->exception); }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/5041f984669fe3a989a84c348eb838c8f7233f6b
5041f984669fe3a989a84c348eb838c8f7233f6b
AutoFill: Release the cached frame when we receive the frameDestroyed() message from WebKit. BUG=48857 TEST=none Review URL: http://codereview.chromium.org/3173005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55789 0039d316-1c4b-4281-b951-d872f2087c98
void RenderView::CheckPreferredSize() { if (!send_preferred_size_changes_ || !webview()) return; gfx::Size size(webview()->mainFrame()->contentsPreferredWidth(), webview()->mainFrame()->documentElementScrollHeight()); if (size == preferred_size_) return; preferred_size_ = size; Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, preferred_size_)); }
void RenderView::CheckPreferredSize() { if (!send_preferred_size_changes_ || !webview()) return; gfx::Size size(webview()->mainFrame()->contentsPreferredWidth(), webview()->mainFrame()->documentElementScrollHeight()); if (size == preferred_size_) return; preferred_size_ = size; Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, preferred_size_)); }
C
Chrome
0
CVE-2015-5296
https://www.cvedetails.com/cve/CVE-2015-5296/
CWE-20
https://git.samba.org/?p=samba.git;a=commit;h=a819d2b440aafa3138d95ff6e8b824da885a70e9
a819d2b440aafa3138d95ff6e8b824da885a70e9
null
void smb2cli_req_set_credit_charge(struct tevent_req *req, uint16_t charge) { struct smbXcli_req_state *state = tevent_req_data(req, struct smbXcli_req_state); state->smb2.credit_charge = charge; }
void smb2cli_req_set_credit_charge(struct tevent_req *req, uint16_t charge) { struct smbXcli_req_state *state = tevent_req_data(req, struct smbXcli_req_state); state->smb2.credit_charge = charge; }
C
samba
0
CVE-2014-2669
https://www.cvedetails.com/cve/CVE-2014-2669/
CWE-189
https://github.com/postgres/postgres/commit/31400a673325147e1205326008e32135a78b4d8a
31400a673325147e1205326008e32135a78b4d8a
Predict integer overflow to avoid buffer overruns. Several functions, mostly type input functions, calculated an allocation size such that the calculation wrapped to a small positive value when arguments implied a sufficiently-large requirement. Writes past the end of the inadvertent small allocation followed shortly thereafter. Coverity identified the path_in() vulnerability; code inspection led to the rest. In passing, add check_stack_depth() to prevent stack overflow in related functions. Back-patch to 8.4 (all supported versions). The non-comment hstore changes touch code that did not exist in 8.4, so that part stops at 9.0. Noah Misch and Heikki Linnakangas, reviewed by Tom Lane. Security: CVE-2014-0064
cmp_txid(const void *aa, const void *bb) { txid a = *(const txid *) aa; txid b = *(const txid *) bb; if (a < b) return -1; if (a > b) return 1; return 0; }
cmp_txid(const void *aa, const void *bb) { txid a = *(const txid *) aa; txid b = *(const txid *) bb; if (a < b) return -1; if (a > b) return 1; return 0; }
C
postgres
0
CVE-2015-6768
https://www.cvedetails.com/cve/CVE-2015-6768/
CWE-264
https://github.com/chromium/chromium/commit/4c8b008f055f79e622344627fed7f820375a4f01
4c8b008f055f79e622344627fed7f820375a4f01
Change Document::detach() to RELEASE_ASSERT all subframes are gone. BUG=556724,577105 Review URL: https://codereview.chromium.org/1667573002 Cr-Commit-Position: refs/heads/master@{#373642}
bool Document::haveImportsLoaded() const { if (!m_importsController) return true; return !m_importsController->shouldBlockScriptExecution(*this); }
bool Document::haveImportsLoaded() const { if (!m_importsController) return true; return !m_importsController->shouldBlockScriptExecution(*this); }
C
Chrome
0
CVE-2010-4818
https://www.cvedetails.com/cve/CVE-2010-4818/
CWE-20
https://cgit.freedesktop.org/xorg/xserver/commit?id=3f0d3f4d97bce75c1828635c322b6560a45a037f
3f0d3f4d97bce75c1828635c322b6560a45a037f
null
int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) { ClientPtr client = cl->client; xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; xGLXQueryExtensionsStringReply reply; __GLXscreen *pGlxScreen; size_t n, length; char *buf; int err; if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; n = strlen(pGlxScreen->GLXextensions) + 1; length = __GLX_PAD(n) >> 2; reply.type = X_Reply; reply.sequenceNumber = client->sequence; reply.length = length; reply.n = n; /* Allocate buffer to make sure it's a multiple of 4 bytes big.*/ buf = (char *) malloc(length << 2); if (buf == NULL) return BadAlloc; memcpy(buf, pGlxScreen->GLXextensions, n); if (client->swapped) { glxSwapQueryExtensionsStringReply(client, &reply, buf); } else { WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply); WriteToClient(client, (int)(length << 2), (char *)buf); } free(buf); return Success; }
int __glXDisp_QueryExtensionsString(__GLXclientState *cl, GLbyte *pc) { ClientPtr client = cl->client; xGLXQueryExtensionsStringReq *req = (xGLXQueryExtensionsStringReq *) pc; xGLXQueryExtensionsStringReply reply; __GLXscreen *pGlxScreen; size_t n, length; char *buf; int err; if (!validGlxScreen(client, req->screen, &pGlxScreen, &err)) return err; n = strlen(pGlxScreen->GLXextensions) + 1; length = __GLX_PAD(n) >> 2; reply.type = X_Reply; reply.sequenceNumber = client->sequence; reply.length = length; reply.n = n; /* Allocate buffer to make sure it's a multiple of 4 bytes big.*/ buf = (char *) malloc(length << 2); if (buf == NULL) return BadAlloc; memcpy(buf, pGlxScreen->GLXextensions, n); if (client->swapped) { glxSwapQueryExtensionsStringReply(client, &reply, buf); } else { WriteToClient(client, sz_xGLXQueryExtensionsStringReply,(char *)&reply); WriteToClient(client, (int)(length << 2), (char *)buf); } free(buf); return Success; }
C
xserver
0
CVE-2015-5366
https://www.cvedetails.com/cve/CVE-2015-5366/
CWE-399
https://github.com/torvalds/linux/commit/beb39db59d14990e401e235faf66a6b9b31240b0
beb39db59d14990e401e235faf66a6b9b31240b0
udp: fix behavior of wrong checksums We have two problems in UDP stack related to bogus checksums : 1) We return -EAGAIN to application even if receive queue is not empty. This breaks applications using edge trigger epoll() 2) Under UDP flood, we can loop forever without yielding to other processes, potentially hanging the host, especially on non SMP. This patch is an attempt to make things better. We might in the future add extra support for rt applications wanting to better control time spent doing a recv() in a hostile environment. For example we could validate checksums before queuing packets in socket receive queue. Signed-off-by: Eric Dumazet <[email protected]> Cc: Willem de Bruijn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static struct sock *udp6_lib_lookup2(struct net *net, const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr, unsigned int hnum, int dif, struct udp_hslot *hslot2, unsigned int slot2) { struct sock *sk, *result; struct hlist_nulls_node *node; int score, badness, matches = 0, reuseport = 0; u32 hash = 0; begin: result = NULL; badness = -1; udp_portaddr_for_each_entry_rcu(sk, node, &hslot2->head) { score = compute_score2(sk, net, saddr, sport, daddr, hnum, dif); if (score > badness) { result = sk; badness = score; reuseport = sk->sk_reuseport; if (reuseport) { hash = udp6_ehashfn(net, daddr, hnum, saddr, sport); matches = 1; } else if (score == SCORE2_MAX) goto exact_match; } else if (score == badness && reuseport) { matches++; if (reciprocal_scale(hash, matches) == 0) result = sk; hash = next_pseudo_random32(hash); } } /* * if the nulls value we got at the end of this lookup is * not the expected one, we must restart lookup. * We probably met an item that was moved to another chain. */ if (get_nulls_value(node) != slot2) goto begin; if (result) { exact_match: if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2))) result = NULL; else if (unlikely(compute_score2(result, net, saddr, sport, daddr, hnum, dif) < badness)) { sock_put(result); goto begin; } } return result; }
static struct sock *udp6_lib_lookup2(struct net *net, const struct in6_addr *saddr, __be16 sport, const struct in6_addr *daddr, unsigned int hnum, int dif, struct udp_hslot *hslot2, unsigned int slot2) { struct sock *sk, *result; struct hlist_nulls_node *node; int score, badness, matches = 0, reuseport = 0; u32 hash = 0; begin: result = NULL; badness = -1; udp_portaddr_for_each_entry_rcu(sk, node, &hslot2->head) { score = compute_score2(sk, net, saddr, sport, daddr, hnum, dif); if (score > badness) { result = sk; badness = score; reuseport = sk->sk_reuseport; if (reuseport) { hash = udp6_ehashfn(net, daddr, hnum, saddr, sport); matches = 1; } else if (score == SCORE2_MAX) goto exact_match; } else if (score == badness && reuseport) { matches++; if (reciprocal_scale(hash, matches) == 0) result = sk; hash = next_pseudo_random32(hash); } } /* * if the nulls value we got at the end of this lookup is * not the expected one, we must restart lookup. * We probably met an item that was moved to another chain. */ if (get_nulls_value(node) != slot2) goto begin; if (result) { exact_match: if (unlikely(!atomic_inc_not_zero_hint(&result->sk_refcnt, 2))) result = NULL; else if (unlikely(compute_score2(result, net, saddr, sport, daddr, hnum, dif) < badness)) { sock_put(result); goto begin; } } return result; }
C
linux
0
CVE-2015-0273
https://www.cvedetails.com/cve/CVE-2015-0273/
null
https://git.php.net/?p=php-src.git;a=commit;h=71335e6ebabc1b12c057d8017fd811892ecdfd24
71335e6ebabc1b12c057d8017fd811892ecdfd24
null
static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) { php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); if (!o1->time || !o2->time) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object"); return 1; } if (!o1->time->sse_uptodate) { timelib_update_ts(o1->time, o1->time->tz_info); } if (!o2->time->sse_uptodate) { timelib_update_ts(o2->time, o2->time->tz_info); } return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse < o2->time->sse) ? -1 : 1); }
static int date_object_compare_date(zval *d1, zval *d2 TSRMLS_DC) { php_date_obj *o1 = zend_object_store_get_object(d1 TSRMLS_CC); php_date_obj *o2 = zend_object_store_get_object(d2 TSRMLS_CC); if (!o1->time || !o2->time) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to compare an incomplete DateTime or DateTimeImmutable object"); return 1; } if (!o1->time->sse_uptodate) { timelib_update_ts(o1->time, o1->time->tz_info); } if (!o2->time->sse_uptodate) { timelib_update_ts(o2->time, o2->time->tz_info); } return (o1->time->sse == o2->time->sse) ? 0 : ((o1->time->sse < o2->time->sse) ? -1 : 1); }
C
php
0
CVE-2016-5773
https://www.cvedetails.com/cve/CVE-2016-5773/
CWE-416
https://github.com/php/php-src/commit/f6aef68089221c5ea047d4a74224ee3deead99a6?w=1
f6aef68089221c5ea047d4a74224ee3deead99a6?w=1
Fix bug #72434: ZipArchive class Use After Free Vulnerability in PHP's GC algorithm and unserialize
static ZIPARCHIVE_METHOD(renameName) { struct zip *intern; zval *this = getThis(); struct zip_stat sb; char *name, *new_name; int name_len, new_name_len; if (!this) { RETURN_FALSE; } ZIP_FROM_OBJECT(intern, this); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) { return; } if (new_name_len < 1) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name"); RETURN_FALSE; } PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); if (zip_rename(intern, sb.index, (const char *)new_name)) { RETURN_FALSE; } RETURN_TRUE; }
static ZIPARCHIVE_METHOD(renameName) { struct zip *intern; zval *this = getThis(); struct zip_stat sb; char *name, *new_name; int name_len, new_name_len; if (!this) { RETURN_FALSE; } ZIP_FROM_OBJECT(intern, this); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) { return; } if (new_name_len < 1) { php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Empty string as new entry name"); RETURN_FALSE; } PHP_ZIP_STAT_PATH(intern, name, name_len, 0, sb); if (zip_rename(intern, sb.index, (const char *)new_name)) { RETURN_FALSE; } RETURN_TRUE; }
C
php-src
0
CVE-2016-6198
https://www.cvedetails.com/cve/CVE-2016-6198/
CWE-284
https://github.com/torvalds/linux/commit/9409e22acdfc9153f88d9b1ed2bd2a5b34d2d3ca
9409e22acdfc9153f88d9b1ed2bd2a5b34d2d3ca
vfs: rename: check backing inode being equal If a file is renamed to a hardlink of itself POSIX specifies that rename(2) should do nothing and return success. This condition is checked in vfs_rename(). However it won't detect hard links on overlayfs where these are given separate inodes on the overlayfs layer. Overlayfs itself detects this condition and returns success without doing anything, but then vfs_rename() will proceed as if this was a successful rename (detach_mounts(), d_move()). The correct thing to do is to detect this condition before even calling into overlayfs. This patch does this by calling vfs_select_inode() to get the underlying inodes. Signed-off-by: Miklos Szeredi <[email protected]> Cc: <[email protected]> # v4.2+
static int follow_dotdot_rcu(struct nameidata *nd) { struct inode *inode = nd->inode; while (1) { if (path_equal(&nd->path, &nd->root)) break; if (nd->path.dentry != nd->path.mnt->mnt_root) { struct dentry *old = nd->path.dentry; struct dentry *parent = old->d_parent; unsigned seq; inode = parent->d_inode; seq = read_seqcount_begin(&parent->d_seq); if (unlikely(read_seqcount_retry(&old->d_seq, nd->seq))) return -ECHILD; nd->path.dentry = parent; nd->seq = seq; if (unlikely(!path_connected(&nd->path))) return -ENOENT; break; } else { struct mount *mnt = real_mount(nd->path.mnt); struct mount *mparent = mnt->mnt_parent; struct dentry *mountpoint = mnt->mnt_mountpoint; struct inode *inode2 = mountpoint->d_inode; unsigned seq = read_seqcount_begin(&mountpoint->d_seq); if (unlikely(read_seqretry(&mount_lock, nd->m_seq))) return -ECHILD; if (&mparent->mnt == nd->path.mnt) break; /* we know that mountpoint was pinned */ nd->path.dentry = mountpoint; nd->path.mnt = &mparent->mnt; inode = inode2; nd->seq = seq; } } while (unlikely(d_mountpoint(nd->path.dentry))) { struct mount *mounted; mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry); if (unlikely(read_seqretry(&mount_lock, nd->m_seq))) return -ECHILD; if (!mounted) break; nd->path.mnt = &mounted->mnt; nd->path.dentry = mounted->mnt.mnt_root; inode = nd->path.dentry->d_inode; nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); } nd->inode = inode; return 0; }
static int follow_dotdot_rcu(struct nameidata *nd) { struct inode *inode = nd->inode; while (1) { if (path_equal(&nd->path, &nd->root)) break; if (nd->path.dentry != nd->path.mnt->mnt_root) { struct dentry *old = nd->path.dentry; struct dentry *parent = old->d_parent; unsigned seq; inode = parent->d_inode; seq = read_seqcount_begin(&parent->d_seq); if (unlikely(read_seqcount_retry(&old->d_seq, nd->seq))) return -ECHILD; nd->path.dentry = parent; nd->seq = seq; if (unlikely(!path_connected(&nd->path))) return -ENOENT; break; } else { struct mount *mnt = real_mount(nd->path.mnt); struct mount *mparent = mnt->mnt_parent; struct dentry *mountpoint = mnt->mnt_mountpoint; struct inode *inode2 = mountpoint->d_inode; unsigned seq = read_seqcount_begin(&mountpoint->d_seq); if (unlikely(read_seqretry(&mount_lock, nd->m_seq))) return -ECHILD; if (&mparent->mnt == nd->path.mnt) break; /* we know that mountpoint was pinned */ nd->path.dentry = mountpoint; nd->path.mnt = &mparent->mnt; inode = inode2; nd->seq = seq; } } while (unlikely(d_mountpoint(nd->path.dentry))) { struct mount *mounted; mounted = __lookup_mnt(nd->path.mnt, nd->path.dentry); if (unlikely(read_seqretry(&mount_lock, nd->m_seq))) return -ECHILD; if (!mounted) break; nd->path.mnt = &mounted->mnt; nd->path.dentry = mounted->mnt.mnt_root; inode = nd->path.dentry->d_inode; nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq); } nd->inode = inode; return 0; }
C
linux
0
CVE-2012-2816
https://www.cvedetails.com/cve/CVE-2012-2816/
null
https://github.com/chromium/chromium/commit/cd0bd79d6ebdb72183e6f0833673464cc10b3600
cd0bd79d6ebdb72183e6f0833673464cc10b3600
Convert plugin and GPU process to brokered handle duplication. BUG=119250 Review URL: https://chromiumcodereview.appspot.com/9958034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132303 0039d316-1c4b-4281-b951-d872f2087c98
void* WebGraphicsContext3DCommandBufferImpl::mapBufferSubDataCHROMIUM( WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, WGC3Denum access) { return gl_->MapBufferSubDataCHROMIUM(target, offset, size, access); }
void* WebGraphicsContext3DCommandBufferImpl::mapBufferSubDataCHROMIUM( WGC3Denum target, WGC3Dintptr offset, WGC3Dsizeiptr size, WGC3Denum access) { return gl_->MapBufferSubDataCHROMIUM(target, offset, size, access); }
C
Chrome
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Err url_Write(GF_Box *s, GF_BitStream *bs) { GF_Err e; GF_DataEntryURLBox *ptr = (GF_DataEntryURLBox *)s; e = gf_isom_full_box_write(s, bs); if (e) return e; if ( !(ptr->flags & 1)) { if (ptr->location) { gf_bs_write_data(bs, ptr->location, (u32)strlen(ptr->location) + 1); } } return GF_OK; }
GF_Err url_Write(GF_Box *s, GF_BitStream *bs) { GF_Err e; GF_DataEntryURLBox *ptr = (GF_DataEntryURLBox *)s; e = gf_isom_full_box_write(s, bs); if (e) return e; if ( !(ptr->flags & 1)) { if (ptr->location) { gf_bs_write_data(bs, ptr->location, (u32)strlen(ptr->location) + 1); } } return GF_OK; }
C
gpac
0
CVE-2019-11599
https://www.cvedetails.com/cve/CVE-2019-11599/
CWE-362
https://github.com/torvalds/linux/commit/04f5866e41fb70690e28397487d8bd8eea7d712a
04f5866e41fb70690e28397487d8bd8eea7d712a
coredump: fix race condition between mmget_not_zero()/get_task_mm() and core dumping The core dumping code has always run without holding the mmap_sem for writing, despite that is the only way to ensure that the entire vma layout will not change from under it. Only using some signal serialization on the processes belonging to the mm is not nearly enough. This was pointed out earlier. For example in Hugh's post from Jul 2017: https://lkml.kernel.org/r/[email protected] "Not strictly relevant here, but a related note: I was very surprised to discover, only quite recently, how handle_mm_fault() may be called without down_read(mmap_sem) - when core dumping. That seems a misguided optimization to me, which would also be nice to correct" In particular because the growsdown and growsup can move the vm_start/vm_end the various loops the core dump does around the vma will not be consistent if page faults can happen concurrently. Pretty much all users calling mmget_not_zero()/get_task_mm() and then taking the mmap_sem had the potential to introduce unexpected side effects in the core dumping code. Adding mmap_sem for writing around the ->core_dump invocation is a viable long term fix, but it requires removing all copy user and page faults and to replace them with get_dump_page() for all binary formats which is not suitable as a short term fix. For the time being this solution manually covers the places that can confuse the core dump either by altering the vma layout or the vma flags while it runs. Once ->core_dump runs under mmap_sem for writing the function mmget_still_valid() can be dropped. Allowing mmap_sem protected sections to run in parallel with the coredump provides some minor parallelism advantage to the swapoff code (which seems to be safe enough by never mangling any vma field and can keep doing swapins in parallel to the core dumping) and to some other corner case. In order to facilitate the backporting I added "Fixes: 86039bd3b4e6" however the side effect of this same race condition in /proc/pid/mem should be reproducible since before 2.6.12-rc2 so I couldn't add any other "Fixes:" because there's no hash beyond the git genesis commit. Because find_extend_vma() is the only location outside of the process context that could modify the "mm" structures under mmap_sem for reading, by adding the mmget_still_valid() check to it, all other cases that take the mmap_sem for reading don't need the new check after mmget_not_zero()/get_task_mm(). The expand_stack() in page fault context also doesn't need the new check, because all tasks under core dumping are frozen. Link: http://lkml.kernel.org/r/[email protected] Fixes: 86039bd3b4e6 ("userfaultfd: add new syscall to provide memory externalization") Signed-off-by: Andrea Arcangeli <[email protected]> Reported-by: Jann Horn <[email protected]> Suggested-by: Oleg Nesterov <[email protected]> Acked-by: Peter Xu <[email protected]> Reviewed-by: Mike Rapoport <[email protected]> Reviewed-by: Oleg Nesterov <[email protected]> Reviewed-by: Jann Horn <[email protected]> Acked-by: Jason Gunthorpe <[email protected]> Acked-by: Michal Hocko <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, struct vm_area_struct *prev, unsigned long end) { struct vm_area_struct **insertion_point; struct vm_area_struct *tail_vma = NULL; insertion_point = (prev ? &prev->vm_next : &mm->mmap); vma->vm_prev = NULL; do { vma_rb_erase(vma, &mm->mm_rb); mm->map_count--; tail_vma = vma; vma = vma->vm_next; } while (vma && vma->vm_start < end); *insertion_point = vma; if (vma) { vma->vm_prev = prev; vma_gap_update(vma); } else mm->highest_vm_end = prev ? vm_end_gap(prev) : 0; tail_vma->vm_next = NULL; /* Kill the cache */ vmacache_invalidate(mm); }
detach_vmas_to_be_unmapped(struct mm_struct *mm, struct vm_area_struct *vma, struct vm_area_struct *prev, unsigned long end) { struct vm_area_struct **insertion_point; struct vm_area_struct *tail_vma = NULL; insertion_point = (prev ? &prev->vm_next : &mm->mmap); vma->vm_prev = NULL; do { vma_rb_erase(vma, &mm->mm_rb); mm->map_count--; tail_vma = vma; vma = vma->vm_next; } while (vma && vma->vm_start < end); *insertion_point = vma; if (vma) { vma->vm_prev = prev; vma_gap_update(vma); } else mm->highest_vm_end = prev ? vm_end_gap(prev) : 0; tail_vma->vm_next = NULL; /* Kill the cache */ vmacache_invalidate(mm); }
C
linux
0
CVE-2016-10270
https://www.cvedetails.com/cve/CVE-2016-10270/
CWE-125
https://github.com/vadz/libtiff/commit/9a72a69e035ee70ff5c41541c8c61cd97990d018
9a72a69e035ee70ff5c41541c8c61cd97990d018
* libtiff/tif_dirread.c: modify ChopUpSingleUncompressedStrip() to instanciate compute ntrips as TIFFhowmany_32(td->td_imagelength, rowsperstrip), instead of a logic based on the total size of data. Which is faulty is the total size of data is not sufficient to fill the whole image, and thus results in reading outside of the StripByCounts/StripOffsets arrays when using TIFFReadScanline(). Reported by Agostino Sarubbo. Fixes http://bugzilla.maptools.org/show_bug.cgi?id=2608. * libtiff/tif_strip.c: revert the change in TIFFNumberOfStrips() done for http://bugzilla.maptools.org/show_bug.cgi?id=2587 / CVE-2016-9273 since the above change is a better fix that makes it unnecessary.
TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii) { int32 ma,mb,mc; ma=-1; mc=(int32)tif->tif_nfields; while (1) { if (ma+1==mc) { *fii = FAILED_FII; return; } mb=(ma+mc)/2; if (tif->tif_fields[mb]->field_tag==(uint32)tagid) break; if (tif->tif_fields[mb]->field_tag<(uint32)tagid) ma=mb; else mc=mb; } while (1) { if (mb==0) break; if (tif->tif_fields[mb-1]->field_tag!=(uint32)tagid) break; mb--; } *fii=mb; }
TIFFReadDirectoryFindFieldInfo(TIFF* tif, uint16 tagid, uint32* fii) { int32 ma,mb,mc; ma=-1; mc=(int32)tif->tif_nfields; while (1) { if (ma+1==mc) { *fii = FAILED_FII; return; } mb=(ma+mc)/2; if (tif->tif_fields[mb]->field_tag==(uint32)tagid) break; if (tif->tif_fields[mb]->field_tag<(uint32)tagid) ma=mb; else mc=mb; } while (1) { if (mb==0) break; if (tif->tif_fields[mb-1]->field_tag!=(uint32)tagid) break; mb--; } *fii=mb; }
C
libtiff
0
null
null
null
https://github.com/chromium/chromium/commit/19190765882e272a6a2162c89acdb29110f7e3cf
19190765882e272a6a2162c89acdb29110f7e3cf
Revert 102184 - [Sync] use base::Time in sync Make EntryKernel/Entry/BaseNode use base::Time instead of int64s. Add sync/util/time.h, with utility functions to manage the sync proto time format. Store times on disk in proto format instead of the local system. This requires a database version bump (to 77). Update SessionChangeProcessor/SessionModelAssociator to use base::Time, too. Remove hackish Now() function. Remove ZeroFields() function, and instead zero-initialize in EntryKernel::EntryKernel() directly. BUG= TEST= Review URL: http://codereview.chromium.org/7981006 [email protected] Review URL: http://codereview.chromium.org/7977034 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102186 0039d316-1c4b-4281-b951-d872f2087c98
void SessionModelAssociator::DisassociateForeignSession( const std::string& foreign_session_tag) { DCHECK(CalledOnValidThread()); synced_session_tracker_.DeleteSession(foreign_session_tag); }
void SessionModelAssociator::DisassociateForeignSession( const std::string& foreign_session_tag) { DCHECK(CalledOnValidThread()); synced_session_tracker_.DeleteSession(foreign_session_tag); }
C
Chrome
0
CVE-2018-6125
null
null
https://github.com/chromium/chromium/commit/ac149a8d4371c0e01e0934fdd57b09e86f96b5b9
ac149a8d4371c0e01e0934fdd57b09e86f96b5b9
Remove libusb-Windows support for HID devices This patch removes the Windows-specific support in libusb that provided a translation between the WinUSB API and the HID API. Applications currently depending on this using the chrome.usb API should switch to using the chrome.hid API. Bug: 818592 Change-Id: I82ee6ccdcbccc21d2910dc62845c7785e78b64f6 Reviewed-on: https://chromium-review.googlesource.com/951635 Reviewed-by: Ken Rockot <[email protected]> Commit-Queue: Reilly Grant <[email protected]> Cr-Commit-Position: refs/heads/master@{#541265}
static unsigned long get_ancestor_session_id(DWORD devinst, unsigned level) { DWORD parent_devinst; unsigned long session_id = 0; char* sanitized_path = NULL; char path[MAX_PATH_LENGTH]; unsigned i; if (level < 1) return 0; for (i = 0; i<level; i++) { if (CM_Get_Parent(&parent_devinst, devinst, 0) != CR_SUCCESS) { return 0; } devinst = parent_devinst; } if (CM_Get_Device_IDA(devinst, path, MAX_PATH_LENGTH, 0) != CR_SUCCESS) { return 0; } sanitized_path = sanitize_path(path); if (sanitized_path == NULL) { return 0; } session_id = htab_hash(sanitized_path); safe_free(sanitized_path); return session_id; }
static unsigned long get_ancestor_session_id(DWORD devinst, unsigned level) { DWORD parent_devinst; unsigned long session_id = 0; char* sanitized_path = NULL; char path[MAX_PATH_LENGTH]; unsigned i; if (level < 1) return 0; for (i = 0; i<level; i++) { if (CM_Get_Parent(&parent_devinst, devinst, 0) != CR_SUCCESS) { return 0; } devinst = parent_devinst; } if (CM_Get_Device_IDA(devinst, path, MAX_PATH_LENGTH, 0) != CR_SUCCESS) { return 0; } sanitized_path = sanitize_path(path); if (sanitized_path == NULL) { return 0; } session_id = htab_hash(sanitized_path); safe_free(sanitized_path); return session_id; }
C
Chrome
0
CVE-2014-4652
https://www.cvedetails.com/cve/CVE-2014-4652/
CWE-362
https://github.com/torvalds/linux/commit/07f4d9d74a04aa7c72c5dae0ef97565f28f17b92
07f4d9d74a04aa7c72c5dae0ef97565f28f17b92
ALSA: control: Protect user controls against concurrent access The user-control put and get handlers as well as the tlv do not protect against concurrent access from multiple threads. Since the state of the control is not updated atomically it is possible that either two write operations or a write and a read operation race against each other. Both can lead to arbitrary memory disclosure. This patch introduces a new lock that protects user-controls from concurrent access. Since applications typically access controls sequentially than in parallel a single lock per card should be fine. Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
static int snd_disconnect_mmap(struct file *file, struct vm_area_struct *vma) { return -ENODEV; }
static int snd_disconnect_mmap(struct file *file, struct vm_area_struct *vma) { return -ENODEV; }
C
linux
0
CVE-2013-0886
https://www.cvedetails.com/cve/CVE-2013-0886/
null
https://github.com/chromium/chromium/commit/18d67244984a574ba2dd8779faabc0e3e34f4b76
18d67244984a574ba2dd8779faabc0e3e34f4b76
Implement TextureImageTransportSurface using texture mailbox This has a couple of advantages: - allow tearing down and recreating the UI parent context without losing the renderer contexts - do not require a context to be able to generate textures when creating the GLSurfaceHandle - clearer ownership semantics that potentially allows for more robust and easier lost context handling/thumbnailing/etc., since a texture is at any given time owned by either: UI parent, mailbox, or TextureImageTransportSurface - simplify frontbuffer protection logic; the frontbuffer textures are now owned by RWHV where they are refcounted The TextureImageTransportSurface informs RenderWidgetHostView of the mailbox names for the front- and backbuffer textures by associating them with a surface_handle (1 or 2) in the AcceleratedSurfaceNew message. During SwapBuffers() or PostSubBuffer() cycles, it then uses produceTextureCHROMIUM() and consumeTextureCHROMIUM() to transfer ownership between renderer and browser compositor. RWHV sends back the surface_handle of the buffer being returned with the Swap ACK (or 0 if no buffer is being returned in which case TextureImageTransportSurface will allocate a new texture - note that this could be used to simply keep textures for thumbnailing). BUG=154815,139616 [email protected] Review URL: https://chromiumcodereview.appspot.com/11194042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171569 0039d316-1c4b-4281-b951-d872f2087c98
void RenderWidgetHostImpl::Destroy() { NotificationService::current()->Notify( NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, Source<RenderWidgetHost>(this), NotificationService::NoDetails()); if (view_) view_->Destroy(); delete this; }
void RenderWidgetHostImpl::Destroy() { NotificationService::current()->Notify( NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, Source<RenderWidgetHost>(this), NotificationService::NoDetails()); if (view_) view_->Destroy(); delete this; }
C
Chrome
0
CVE-2011-3053
https://www.cvedetails.com/cve/CVE-2011-3053/
CWE-399
https://github.com/chromium/chromium/commit/c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
c442b3eda2f1fdd4d1d4864c34c43cbaf223acae
chromeos: Move audio, power, and UI files into subdirs. This moves more files from chrome/browser/chromeos/ into subdirectories. BUG=chromium-os:22896 TEST=did chrome os builds both with and without aura TBR=sky Review URL: http://codereview.chromium.org/9125006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116746 0039d316-1c4b-4281-b951-d872f2087c98
string16 DefaultBrowserInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringUTF16(IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT); }
string16 DefaultBrowserInfoBarDelegate::GetMessageText() const { return l10n_util::GetStringUTF16(IDS_DEFAULT_BROWSER_INFOBAR_SHORT_TEXT); }
C
Chrome
0
CVE-2018-17204
https://www.cvedetails.com/cve/CVE-2018-17204/
CWE-617
https://github.com/openvswitch/ovs/commit/4af6da3b275b764b1afe194df6499b33d2bf4cde
4af6da3b275b764b1afe194df6499b33d2bf4cde
ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command. When decoding a group mod, the current code validates the group type and command after the whole group mod has been decoded. The OF1.5 decoder, however, tries to use the type and command earlier, when it might still be invalid. This caused an assertion failure (via OVS_NOT_REACHED). This commit fixes the problem. ovs-vswitchd does not enable support for OpenFlow 1.5 by default. Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9249 Signed-off-by: Ben Pfaff <[email protected]> Reviewed-by: Yifeng Sun <[email protected]>
ofputil_append_table_desc_reply(const struct ofputil_table_desc *td, struct ovs_list *replies, enum ofp_version version) { struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies)); size_t start_otd; struct ofp14_table_desc *otd; start_otd = reply->size; ofpbuf_put_zeros(reply, sizeof *otd); if (td->eviction_flags != UINT32_MAX) { ofpprop_put_u32(reply, OFPTMPT14_EVICTION, td->eviction_flags); } if (td->vacancy == OFPUTIL_TABLE_VACANCY_ON) { struct ofp14_table_mod_prop_vacancy *otv; otv = ofpprop_put_zeros(reply, OFPTMPT14_VACANCY, sizeof *otv); otv->vacancy_down = td->table_vacancy.vacancy_down; otv->vacancy_up = td->table_vacancy.vacancy_up; otv->vacancy = td->table_vacancy.vacancy; } otd = ofpbuf_at_assert(reply, start_otd, sizeof *otd); otd->length = htons(reply->size - start_otd); otd->table_id = td->table_id; otd->config = ofputil_encode_table_config(OFPUTIL_TABLE_MISS_DEFAULT, td->eviction, td->vacancy, version); ofpmp_postappend(replies, start_otd); }
ofputil_append_table_desc_reply(const struct ofputil_table_desc *td, struct ovs_list *replies, enum ofp_version version) { struct ofpbuf *reply = ofpbuf_from_list(ovs_list_back(replies)); size_t start_otd; struct ofp14_table_desc *otd; start_otd = reply->size; ofpbuf_put_zeros(reply, sizeof *otd); if (td->eviction_flags != UINT32_MAX) { ofpprop_put_u32(reply, OFPTMPT14_EVICTION, td->eviction_flags); } if (td->vacancy == OFPUTIL_TABLE_VACANCY_ON) { struct ofp14_table_mod_prop_vacancy *otv; otv = ofpprop_put_zeros(reply, OFPTMPT14_VACANCY, sizeof *otv); otv->vacancy_down = td->table_vacancy.vacancy_down; otv->vacancy_up = td->table_vacancy.vacancy_up; otv->vacancy = td->table_vacancy.vacancy; } otd = ofpbuf_at_assert(reply, start_otd, sizeof *otd); otd->length = htons(reply->size - start_otd); otd->table_id = td->table_id; otd->config = ofputil_encode_table_config(OFPUTIL_TABLE_MISS_DEFAULT, td->eviction, td->vacancy, version); ofpmp_postappend(replies, start_otd); }
C
ovs
0
null
null
null
https://github.com/chromium/chromium/commit/ea3d1d84be3d6f97bf50e76511c9e26af6895533
ea3d1d84be3d6f97bf50e76511c9e26af6895533
Fix passing pointers between processes. BUG=31880 Review URL: http://codereview.chromium.org/558036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37555 0039d316-1c4b-4281-b951-d872f2087c98
int WebPluginDelegateImpl::GetProcessId() { return base::GetCurrentProcId(); }
int WebPluginDelegateImpl::GetProcessId() { return base::GetCurrentProcId(); }
C
Chrome
0
CVE-2013-2141
https://www.cvedetails.com/cve/CVE-2013-2141/
CWE-399
https://github.com/torvalds/linux/commit/b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f
b9e146d8eb3b9ecae5086d373b50fa0c1f3e7f0f
kernel/signal.c: stop info leak via the tkill and the tgkill syscalls This fixes a kernel memory contents leak via the tkill and tgkill syscalls for compat processes. This is visible in the siginfo_t->_sifields._rt.si_sigval.sival_ptr field when handling signals delivered from tkill. The place of the infoleak: int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) { ... put_user_ex(ptr_to_compat(from->si_ptr), &to->si_ptr); ... } Signed-off-by: Emese Revfy <[email protected]> Reviewed-by: PaX Team <[email protected]> Signed-off-by: Kees Cook <[email protected]> Cc: Al Viro <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: "Eric W. Biederman" <[email protected]> Cc: Serge Hallyn <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
int kill_proc_info(int sig, struct siginfo *info, pid_t pid) { int error; rcu_read_lock(); error = kill_pid_info(sig, info, find_vpid(pid)); rcu_read_unlock(); return error; }
int kill_proc_info(int sig, struct siginfo *info, pid_t pid) { int error; rcu_read_lock(); error = kill_pid_info(sig, info, find_vpid(pid)); rcu_read_unlock(); return error; }
C
linux
0
CVE-2017-6903
https://www.cvedetails.com/cve/CVE-2017-6903/
CWE-269
https://github.com/iortcw/iortcw/commit/b6ff2bcb1e4e6976d61e316175c6d7c99860fe20
b6ff2bcb1e4e6976d61e316175c6d7c99860fe20
All: Don't load .pk3s as .dlls, and don't load user config files from .pk3s
void CL_MapLoading( void ) { if ( com_dedicated->integer ) { clc.state = CA_DISCONNECTED; Key_SetCatcher( KEYCATCH_CONSOLE ); return; } if ( !com_cl_running->integer ) { return; } Con_Close(); Key_SetCatcher( 0 ); if ( clc.state >= CA_CONNECTED && !Q_stricmp( clc.servername, "localhost" ) ) { clc.state = CA_CONNECTED; // so the connect screen is drawn Com_Memset( cls.updateInfoString, 0, sizeof( cls.updateInfoString ) ); Com_Memset( clc.serverMessage, 0, sizeof( clc.serverMessage ) ); Com_Memset( &cl.gameState, 0, sizeof( cl.gameState ) ); clc.lastPacketSentTime = -9999; SCR_UpdateScreen(); } else { Cvar_Set( "nextmap", "" ); CL_Disconnect( qtrue ); Q_strncpyz( clc.servername, "localhost", sizeof(clc.servername) ); clc.state = CA_CHALLENGING; // so the connect screen is drawn Key_SetCatcher( 0 ); SCR_UpdateScreen(); clc.connectTime = -RETRANSMIT_TIMEOUT; NET_StringToAdr( clc.servername, &clc.serverAddress, NA_UNSPEC); CL_CheckForResend(); } }
void CL_MapLoading( void ) { if ( com_dedicated->integer ) { clc.state = CA_DISCONNECTED; Key_SetCatcher( KEYCATCH_CONSOLE ); return; } if ( !com_cl_running->integer ) { return; } Con_Close(); Key_SetCatcher( 0 ); if ( clc.state >= CA_CONNECTED && !Q_stricmp( clc.servername, "localhost" ) ) { clc.state = CA_CONNECTED; // so the connect screen is drawn Com_Memset( cls.updateInfoString, 0, sizeof( cls.updateInfoString ) ); Com_Memset( clc.serverMessage, 0, sizeof( clc.serverMessage ) ); Com_Memset( &cl.gameState, 0, sizeof( cl.gameState ) ); clc.lastPacketSentTime = -9999; SCR_UpdateScreen(); } else { Cvar_Set( "nextmap", "" ); CL_Disconnect( qtrue ); Q_strncpyz( clc.servername, "localhost", sizeof(clc.servername) ); clc.state = CA_CHALLENGING; // so the connect screen is drawn Key_SetCatcher( 0 ); SCR_UpdateScreen(); clc.connectTime = -RETRANSMIT_TIMEOUT; NET_StringToAdr( clc.servername, &clc.serverAddress, NA_UNSPEC); CL_CheckForResend(); } }
C
OpenJK
0
CVE-2013-7008
https://www.cvedetails.com/cve/CVE-2013-7008/
null
https://github.com/FFmpeg/FFmpeg/commit/29ffeef5e73b8f41ff3a3f2242d356759c66f91f
29ffeef5e73b8f41ff3a3f2242d356759c66f91f
avcodec/h264: do not trust last_pic_droppable when marking pictures as done This simplifies the code and fixes a deadlock Fixes Ticket2927 Signed-off-by: Michael Niedermayer <[email protected]>
static void clone_tables(H264Context *dst, H264Context *src, int i) { dst->intra4x4_pred_mode = src->intra4x4_pred_mode + i * 8 * 2 * src->mb_stride; dst->non_zero_count = src->non_zero_count; dst->slice_table = src->slice_table; dst->cbp_table = src->cbp_table; dst->mb2b_xy = src->mb2b_xy; dst->mb2br_xy = src->mb2br_xy; dst->chroma_pred_mode_table = src->chroma_pred_mode_table; dst->mvd_table[0] = src->mvd_table[0] + i * 8 * 2 * src->mb_stride; dst->mvd_table[1] = src->mvd_table[1] + i * 8 * 2 * src->mb_stride; dst->direct_table = src->direct_table; dst->list_counts = src->list_counts; dst->DPB = src->DPB; dst->cur_pic_ptr = src->cur_pic_ptr; dst->cur_pic = src->cur_pic; dst->bipred_scratchpad = NULL; dst->edge_emu_buffer = NULL; dst->me.scratchpad = NULL; ff_h264_pred_init(&dst->hpc, src->avctx->codec_id, src->sps.bit_depth_luma, src->sps.chroma_format_idc); }
static void clone_tables(H264Context *dst, H264Context *src, int i) { dst->intra4x4_pred_mode = src->intra4x4_pred_mode + i * 8 * 2 * src->mb_stride; dst->non_zero_count = src->non_zero_count; dst->slice_table = src->slice_table; dst->cbp_table = src->cbp_table; dst->mb2b_xy = src->mb2b_xy; dst->mb2br_xy = src->mb2br_xy; dst->chroma_pred_mode_table = src->chroma_pred_mode_table; dst->mvd_table[0] = src->mvd_table[0] + i * 8 * 2 * src->mb_stride; dst->mvd_table[1] = src->mvd_table[1] + i * 8 * 2 * src->mb_stride; dst->direct_table = src->direct_table; dst->list_counts = src->list_counts; dst->DPB = src->DPB; dst->cur_pic_ptr = src->cur_pic_ptr; dst->cur_pic = src->cur_pic; dst->bipred_scratchpad = NULL; dst->edge_emu_buffer = NULL; dst->me.scratchpad = NULL; ff_h264_pred_init(&dst->hpc, src->avctx->codec_id, src->sps.bit_depth_luma, src->sps.chroma_format_idc); }
C
FFmpeg
0
CVE-2016-1583
https://www.cvedetails.com/cve/CVE-2016-1583/
CWE-119
https://github.com/torvalds/linux/commit/f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
f5364c150aa645b3d7daa21b5c0b9feaa1c9cd6d
Merge branch 'stacking-fixes' (vfs stacking fixes from Jann) Merge filesystem stacking fixes from Jann Horn. * emailed patches from Jann Horn <[email protected]>: sched: panic on corrupted stack end ecryptfs: forbid opening files without mmap handler proc: prevent stacking filesystems on top
static int proc_parse_options(char *options, struct pid_namespace *pid) { char *p; substring_t args[MAX_OPT_ARGS]; int option; if (!options) return 1; while ((p = strsep(&options, ",")) != NULL) { int token; if (!*p) continue; args[0].to = args[0].from = NULL; token = match_token(p, tokens, args); switch (token) { case Opt_gid: if (match_int(&args[0], &option)) return 0; pid->pid_gid = make_kgid(current_user_ns(), option); break; case Opt_hidepid: if (match_int(&args[0], &option)) return 0; if (option < 0 || option > 2) { pr_err("proc: hidepid value must be between 0 and 2.\n"); return 0; } pid->hide_pid = option; break; default: pr_err("proc: unrecognized mount option \"%s\" " "or missing value\n", p); return 0; } } return 1; }
static int proc_parse_options(char *options, struct pid_namespace *pid) { char *p; substring_t args[MAX_OPT_ARGS]; int option; if (!options) return 1; while ((p = strsep(&options, ",")) != NULL) { int token; if (!*p) continue; args[0].to = args[0].from = NULL; token = match_token(p, tokens, args); switch (token) { case Opt_gid: if (match_int(&args[0], &option)) return 0; pid->pid_gid = make_kgid(current_user_ns(), option); break; case Opt_hidepid: if (match_int(&args[0], &option)) return 0; if (option < 0 || option > 2) { pr_err("proc: hidepid value must be between 0 and 2.\n"); return 0; } pid->hide_pid = option; break; default: pr_err("proc: unrecognized mount option \"%s\" " "or missing value\n", p); return 0; } } return 1; }
C
linux
0
CVE-2016-1615
https://www.cvedetails.com/cve/CVE-2016-1615/
CWE-254
https://github.com/chromium/chromium/commit/b399a05453d7b3e2dfdec67865fefe6953bcc59e
b399a05453d7b3e2dfdec67865fefe6953bcc59e
Allocate a FrameSinkId for RenderWidgetHostViewAura in mus+ash RenderWidgetHostViewChildFrame expects its parent to have a valid FrameSinkId. Make sure RenderWidgetHostViewAura has a FrameSinkId even if DelegatedFrameHost is not used (in mus+ash). BUG=706553 [email protected] Review-Url: https://codereview.chromium.org/2847253003 Cr-Commit-Position: refs/heads/master@{#468179}
void RenderWidgetHostViewAura::SetInsets(const gfx::Insets& insets) { if (insets != insets_) { insets_ = insets; host_->WasResized(); } }
void RenderWidgetHostViewAura::SetInsets(const gfx::Insets& insets) { if (insets != insets_) { insets_ = insets; host_->WasResized(); } }
C
Chrome
0
CVE-2015-1274
https://www.cvedetails.com/cve/CVE-2015-1274/
CWE-254
https://github.com/chromium/chromium/commit/d27468a832d5316884bd02f459cbf493697fd7e1
d27468a832d5316884bd02f459cbf493697fd7e1
Switch to equalIgnoringASCIICase throughout modules/accessibility BUG=627682 Review-Url: https://codereview.chromium.org/2793913007 Cr-Commit-Position: refs/heads/master@{#461858}
void AXObjectCacheImpl::labelChanged(Element* element) { textChanged(toHTMLLabelElement(element)->control()); }
void AXObjectCacheImpl::labelChanged(Element* element) { textChanged(toHTMLLabelElement(element)->control()); }
C
Chrome
0
CVE-2013-1415
https://www.cvedetails.com/cve/CVE-2013-1415/
null
https://github.com/krb5/krb5/commit/f249555301940c6df3a2cdda13b56b5674eebc2e
f249555301940c6df3a2cdda13b56b5674eebc2e
PKINIT null pointer deref [CVE-2013-1415] Don't dereference a null pointer when cleaning up. The KDC plugin for PKINIT can dereference a null pointer when a malformed packet causes processing to terminate early, leading to a crash of the KDC process. An attacker would need to have a valid PKINIT certificate or have observed a successful PKINIT authentication, or an unauthenticated attacker could execute the attack if anonymous PKINIT is enabled. CVSSv2 vector: AV:N/AC:M/Au:N/C:N/I:N/A:C/E:P/RL:O/RC:C This is a minimal commit for pullup; style fixes in a followup. [[email protected]: reformat and edit commit message] (cherry picked from commit c773d3c775e9b2d88bcdff5f8a8ba88d7ec4e8ed) ticket: 7570 version_fixed: 1.11.1 status: resolved
pkinit_create_td_trusted_certifiers(krb5_context context, pkinit_plg_crypto_context plg_cryptoctx, pkinit_req_crypto_context req_cryptoctx, pkinit_identity_crypto_context id_cryptoctx, krb5_pa_data ***e_data_out) { krb5_error_code retval = KRB5KRB_ERR_GENERIC; retval = pkinit_create_sequence_of_principal_identifiers(context, plg_cryptoctx, req_cryptoctx, id_cryptoctx, TD_TRUSTED_CERTIFIERS, e_data_out); return retval; }
pkinit_create_td_trusted_certifiers(krb5_context context, pkinit_plg_crypto_context plg_cryptoctx, pkinit_req_crypto_context req_cryptoctx, pkinit_identity_crypto_context id_cryptoctx, krb5_pa_data ***e_data_out) { krb5_error_code retval = KRB5KRB_ERR_GENERIC; retval = pkinit_create_sequence_of_principal_identifiers(context, plg_cryptoctx, req_cryptoctx, id_cryptoctx, TD_TRUSTED_CERTIFIERS, e_data_out); return retval; }
C
krb5
0
CVE-2016-10066
https://www.cvedetails.com/cve/CVE-2016-10066/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
null
static MagickStatusType ReadPSDLayer(Image *image,const PSDInfo *psd_info, LayerInfo* layer_info,ExceptionInfo *exception) { char message[MaxTextExtent]; MagickStatusType status; PSDCompressionType compression; ssize_t j; if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " setting up new layer image"); (void) SetImageBackgroundColor(layer_info->image); layer_info->image->compose=PSDBlendModeToCompositeOperator( layer_info->blendkey); if (layer_info->visible == MagickFalse) layer_info->image->compose=NoCompositeOp; if (psd_info->mode == CMYKMode) SetImageColorspace(layer_info->image,CMYKColorspace); if ((psd_info->mode == BitmapMode) || (psd_info->mode == GrayscaleMode) || (psd_info->mode == DuotoneMode)) SetImageColorspace(layer_info->image,GRAYColorspace); /* Set up some hidden attributes for folks that need them. */ (void) FormatLocaleString(message,MaxTextExtent,"%.20gld", (double) layer_info->page.x); (void) SetImageArtifact(layer_info->image,"psd:layer.x",message); (void) FormatLocaleString(message,MaxTextExtent,"%.20g", (double) layer_info->page.y); (void) SetImageArtifact(layer_info->image,"psd:layer.y",message); (void) FormatLocaleString(message,MaxTextExtent,"%.20g",(double) layer_info->opacity); (void) SetImageArtifact(layer_info->image,"psd:layer.opacity",message); (void) SetImageProperty(layer_info->image,"label",(char *) layer_info->name); status=MagickTrue; for (j=0; j < (ssize_t) layer_info->channels; j++) { if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " reading data for channel %.20g",(double) j); compression=(PSDCompressionType) ReadBlobMSBShort(layer_info->image); layer_info->image->compression=ConvertPSDCompression(compression); if (layer_info->channel_info[j].type == -1) layer_info->image->matte=MagickTrue; status=ReadPSDChannel(layer_info->image,psd_info,layer_info,j, compression,exception); InheritException(exception,&layer_info->image->exception); if (status == MagickFalse) break; } if (status != MagickFalse) status=CorrectPSDOpacity(layer_info,exception); if (status != MagickFalse && layer_info->image->colorspace == CMYKColorspace) (void) NegateImage(layer_info->image,MagickFalse); return(status); }
static MagickStatusType ReadPSDLayer(Image *image,const PSDInfo *psd_info, LayerInfo* layer_info,ExceptionInfo *exception) { char message[MaxTextExtent]; MagickStatusType status; PSDCompressionType compression; ssize_t j; if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " setting up new layer image"); (void) SetImageBackgroundColor(layer_info->image); layer_info->image->compose=PSDBlendModeToCompositeOperator( layer_info->blendkey); if (layer_info->visible == MagickFalse) layer_info->image->compose=NoCompositeOp; if (psd_info->mode == CMYKMode) SetImageColorspace(layer_info->image,CMYKColorspace); if ((psd_info->mode == BitmapMode) || (psd_info->mode == GrayscaleMode) || (psd_info->mode == DuotoneMode)) SetImageColorspace(layer_info->image,GRAYColorspace); /* Set up some hidden attributes for folks that need them. */ (void) FormatLocaleString(message,MaxTextExtent,"%.20gld", (double) layer_info->page.x); (void) SetImageArtifact(layer_info->image,"psd:layer.x",message); (void) FormatLocaleString(message,MaxTextExtent,"%.20g", (double) layer_info->page.y); (void) SetImageArtifact(layer_info->image,"psd:layer.y",message); (void) FormatLocaleString(message,MaxTextExtent,"%.20g",(double) layer_info->opacity); (void) SetImageArtifact(layer_info->image,"psd:layer.opacity",message); (void) SetImageProperty(layer_info->image,"label",(char *) layer_info->name); status=MagickTrue; for (j=0; j < (ssize_t) layer_info->channels; j++) { if (image->debug != MagickFalse) (void) LogMagickEvent(CoderEvent,GetMagickModule(), " reading data for channel %.20g",(double) j); compression=(PSDCompressionType) ReadBlobMSBShort(layer_info->image); layer_info->image->compression=ConvertPSDCompression(compression); if (layer_info->channel_info[j].type == -1) layer_info->image->matte=MagickTrue; status=ReadPSDChannel(layer_info->image,psd_info,layer_info,j, compression,exception); InheritException(exception,&layer_info->image->exception); if (status == MagickFalse) break; } if (status != MagickFalse) status=CorrectPSDOpacity(layer_info,exception); if (status != MagickFalse && layer_info->image->colorspace == CMYKColorspace) (void) NegateImage(layer_info->image,MagickFalse); return(status); }
C
ImageMagick
0
CVE-2015-8324
https://www.cvedetails.com/cve/CVE-2015-8324/
null
https://github.com/torvalds/linux/commit/744692dc059845b2a3022119871846e74d4f6e11
744692dc059845b2a3022119871846e74d4f6e11
ext4: use ext4_get_block_write in buffer write Allocate uninitialized extent before ext4 buffer write and convert the extent to initialized after io completes. The purpose is to make sure an extent can only be marked initialized after it has been written with new data so we can safely drop the i_mutex lock in ext4 DIO read without exposing stale data. This helps to improve multi-thread DIO read performance on high-speed disks. Skip the nobh and data=journal mount cases to make things simple for now. Signed-off-by: Jiaying Zhang <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
ext4_fsblk_t ext_pblock(struct ext4_extent *ex) { ext4_fsblk_t block; block = le32_to_cpu(ex->ee_start_lo); block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1; return block; }
ext4_fsblk_t ext_pblock(struct ext4_extent *ex) { ext4_fsblk_t block; block = le32_to_cpu(ex->ee_start_lo); block |= ((ext4_fsblk_t) le16_to_cpu(ex->ee_start_hi) << 31) << 1; return block; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/8d4d589fc7d0a8f2fbb7a468e00f264fe54c7981
8d4d589fc7d0a8f2fbb7a468e00f264fe54c7981
2008-03-25 Antti Koivisto <[email protected]> Reviewed by Oliver. Fix http://bugs.webkit.org/show_bug.cgi?id=18082 REGRESSION (r31287): GMail does not work if user stylesheet is set Oops, my cache refactoring patch was missing these rather essential lines for user stylesheets. They would get reloaded repeatedly. * loader/Cache.cpp: (WebCore::Cache::requestUserCSSStyleSheet): git-svn-id: svn://svn.chromium.org/blink/trunk@31307 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void Cache::dumpLRULists(bool includeLive) const { printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded, Access count, Referenced):\n"); int size = m_allResources.size(); for (int i = size - 1; i >= 0; i--) { printf("\n\nList %d: ", i); CachedResource* current = m_allResources[i].m_tail; while (current) { CachedResource* prev = current->m_prevInAllResourcesList; if (includeLive || !current->referenced()) printf("(%.1fK, %.1fK, %uA, %dR); ", current->decodedSize() / 1024.0f, current->encodedSize() / 1024.0f, current->accessCount(), current->referenced()); current = prev; } } }
void Cache::dumpLRULists(bool includeLive) const { printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded, Access count, Referenced):\n"); int size = m_allResources.size(); for (int i = size - 1; i >= 0; i--) { printf("\n\nList %d: ", i); CachedResource* current = m_allResources[i].m_tail; while (current) { CachedResource* prev = current->m_prevInAllResourcesList; if (includeLive || !current->referenced()) printf("(%.1fK, %.1fK, %uA, %dR); ", current->decodedSize() / 1024.0f, current->encodedSize() / 1024.0f, current->accessCount(), current->referenced()); current = prev; } } }
C
Chrome
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Err pdin_Read(GF_Box *s, GF_BitStream *bs) { u32 i; GF_ProgressiveDownloadBox *ptr = (GF_ProgressiveDownloadBox*)s; ptr->count = (u32) (ptr->size) / 8; ptr->rates = (u32*)gf_malloc(sizeof(u32)*ptr->count); ptr->times = (u32*)gf_malloc(sizeof(u32)*ptr->count); for (i=0; i<ptr->count; i++) { ptr->rates[i] = gf_bs_read_u32(bs); ptr->times[i] = gf_bs_read_u32(bs); } return GF_OK; }
GF_Err pdin_Read(GF_Box *s, GF_BitStream *bs) { u32 i; GF_ProgressiveDownloadBox *ptr = (GF_ProgressiveDownloadBox*)s; ptr->count = (u32) (ptr->size) / 8; ptr->rates = (u32*)gf_malloc(sizeof(u32)*ptr->count); ptr->times = (u32*)gf_malloc(sizeof(u32)*ptr->count); for (i=0; i<ptr->count; i++) { ptr->rates[i] = gf_bs_read_u32(bs); ptr->times[i] = gf_bs_read_u32(bs); } return GF_OK; }
C
gpac
0
CVE-2017-7376
https://www.cvedetails.com/cve/CVE-2017-7376/
CWE-119
https://android.googlesource.com/platform/external/libxml2/+/51e0cb2e5ec18eaf6fb331bc573ff27b743898f4
51e0cb2e5ec18eaf6fb331bc573ff27b743898f4
DO NOT MERGE: Use correct limit for port values no upstream report yet, add it here when we have it issue found & patch by nmehta@ Bug: 36555370 Change-Id: Ibf1efea554b95f514e23e939363d608021de4614 (cherry picked from commit b62884fb49fe92081e414966d9b5fe58250ae53c)
xmlParse3986PathAbEmpty(xmlURIPtr uri, const char **str) { const char *cur; int ret; cur = *str; while (*cur == '/') { cur++; ret = xmlParse3986Segment(&cur, 0, 1); if (ret != 0) return(ret); } if (uri != NULL) { if (uri->path != NULL) xmlFree(uri->path); if (*str != cur) { if (uri->cleanup & 2) uri->path = STRNDUP(*str, cur - *str); else uri->path = xmlURIUnescapeString(*str, cur - *str, NULL); } else { uri->path = NULL; } } *str = cur; return (0); }
xmlParse3986PathAbEmpty(xmlURIPtr uri, const char **str) { const char *cur; int ret; cur = *str; while (*cur == '/') { cur++; ret = xmlParse3986Segment(&cur, 0, 1); if (ret != 0) return(ret); } if (uri != NULL) { if (uri->path != NULL) xmlFree(uri->path); if (*str != cur) { if (uri->cleanup & 2) uri->path = STRNDUP(*str, cur - *str); else uri->path = xmlURIUnescapeString(*str, cur - *str, NULL); } else { uri->path = NULL; } } *str = cur; return (0); }
C
Android
0
CVE-2016-7421
https://www.cvedetails.com/cve/CVE-2016-7421/
CWE-399
https://git.qemu.org/?p=qemu.git;a=commit;h=d251157ac1928191af851d199a9ff255d330bec9
d251157ac1928191af851d199a9ff255d330bec9
null
pvscsi_register_types(void) { type_register_static(&pvscsi_info); }
pvscsi_register_types(void) { type_register_static(&pvscsi_info); }
C
qemu
0
CVE-2016-9191
https://www.cvedetails.com/cve/CVE-2016-9191/
CWE-20
https://github.com/torvalds/linux/commit/93362fa47fe98b62e4a34ab408c4a418432e7939
93362fa47fe98b62e4a34ab408c4a418432e7939
sysctl: Drop reference added by grab_header in proc_sys_readdir Fixes CVE-2016-9191, proc_sys_readdir doesn't drop reference added by grab_header when return from !dir_emit_dots path. It can cause any path called unregister_sysctl_table will wait forever. The calltrace of CVE-2016-9191: [ 5535.960522] Call Trace: [ 5535.963265] [<ffffffff817cdaaf>] schedule+0x3f/0xa0 [ 5535.968817] [<ffffffff817d33fb>] schedule_timeout+0x3db/0x6f0 [ 5535.975346] [<ffffffff817cf055>] ? wait_for_completion+0x45/0x130 [ 5535.982256] [<ffffffff817cf0d3>] wait_for_completion+0xc3/0x130 [ 5535.988972] [<ffffffff810d1fd0>] ? wake_up_q+0x80/0x80 [ 5535.994804] [<ffffffff8130de64>] drop_sysctl_table+0xc4/0xe0 [ 5536.001227] [<ffffffff8130de17>] drop_sysctl_table+0x77/0xe0 [ 5536.007648] [<ffffffff8130decd>] unregister_sysctl_table+0x4d/0xa0 [ 5536.014654] [<ffffffff8130deff>] unregister_sysctl_table+0x7f/0xa0 [ 5536.021657] [<ffffffff810f57f5>] unregister_sched_domain_sysctl+0x15/0x40 [ 5536.029344] [<ffffffff810d7704>] partition_sched_domains+0x44/0x450 [ 5536.036447] [<ffffffff817d0761>] ? __mutex_unlock_slowpath+0x111/0x1f0 [ 5536.043844] [<ffffffff81167684>] rebuild_sched_domains_locked+0x64/0xb0 [ 5536.051336] [<ffffffff8116789d>] update_flag+0x11d/0x210 [ 5536.057373] [<ffffffff817cf61f>] ? mutex_lock_nested+0x2df/0x450 [ 5536.064186] [<ffffffff81167acb>] ? cpuset_css_offline+0x1b/0x60 [ 5536.070899] [<ffffffff810fce3d>] ? trace_hardirqs_on+0xd/0x10 [ 5536.077420] [<ffffffff817cf61f>] ? mutex_lock_nested+0x2df/0x450 [ 5536.084234] [<ffffffff8115a9f5>] ? css_killed_work_fn+0x25/0x220 [ 5536.091049] [<ffffffff81167ae5>] cpuset_css_offline+0x35/0x60 [ 5536.097571] [<ffffffff8115aa2c>] css_killed_work_fn+0x5c/0x220 [ 5536.104207] [<ffffffff810bc83f>] process_one_work+0x1df/0x710 [ 5536.110736] [<ffffffff810bc7c0>] ? process_one_work+0x160/0x710 [ 5536.117461] [<ffffffff810bce9b>] worker_thread+0x12b/0x4a0 [ 5536.123697] [<ffffffff810bcd70>] ? process_one_work+0x710/0x710 [ 5536.130426] [<ffffffff810c3f7e>] kthread+0xfe/0x120 [ 5536.135991] [<ffffffff817d4baf>] ret_from_fork+0x1f/0x40 [ 5536.142041] [<ffffffff810c3e80>] ? kthread_create_on_node+0x230/0x230 One cgroup maintainer mentioned that "cgroup is trying to offline a cpuset css, which takes place under cgroup_mutex. The offlining ends up trying to drain active usages of a sysctl table which apprently is not happening." The real reason is that proc_sys_readdir doesn't drop reference added by grab_header when return from !dir_emit_dots path. So this cpuset offline path will wait here forever. See here for details: http://www.openwall.com/lists/oss-security/2016/11/04/13 Fixes: f0c3b5093add ("[readdir] convert procfs") Cc: [email protected] Reported-by: CAI Qian <[email protected]> Tested-by: Yang Shukui <[email protected]> Signed-off-by: Zhou Chengming <[email protected]> Acked-by: Al Viro <[email protected]> Signed-off-by: Eric W. Biederman <[email protected]>
static void next_entry(struct ctl_table_header **phead, struct ctl_table **pentry) { struct ctl_table_header *head = *phead; struct ctl_table *entry = *pentry; struct ctl_node *ctl_node = &head->node[entry - head->ctl_table]; spin_lock(&sysctl_lock); unuse_table(head); ctl_node = first_usable_entry(rb_next(&ctl_node->node)); spin_unlock(&sysctl_lock); head = NULL; if (ctl_node) { head = ctl_node->header; entry = &head->ctl_table[ctl_node - head->node]; } *phead = head; *pentry = entry; }
static void next_entry(struct ctl_table_header **phead, struct ctl_table **pentry) { struct ctl_table_header *head = *phead; struct ctl_table *entry = *pentry; struct ctl_node *ctl_node = &head->node[entry - head->ctl_table]; spin_lock(&sysctl_lock); unuse_table(head); ctl_node = first_usable_entry(rb_next(&ctl_node->node)); spin_unlock(&sysctl_lock); head = NULL; if (ctl_node) { head = ctl_node->header; entry = &head->ctl_table[ctl_node - head->node]; } *phead = head; *pentry = entry; }
C
linux
0
CVE-2013-0904
https://www.cvedetails.com/cve/CVE-2013-0904/
CWE-119
https://github.com/chromium/chromium/commit/b2b21468c1f7f08b30a7c1755316f6026c50eb2a
b2b21468c1f7f08b30a7c1755316f6026c50eb2a
Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e.g. StyleDifferenceLayout implies StyleDifferenceRepaint). This causes unnecessary repaints in some cases on layout change. Convert StyleDifference to a structure containing relatively independent flags. This change doesn't directly improve the result, but can make further repaint optimizations possible. Step 1 doesn't change any functionality. RenderStyle still generate the legacy StyleDifference enum when comparing styles and convert the result to the new StyleDifference. Implicit requirements are not handled during the conversion. Converted call sites to use the new StyleDifference according to the following conversion rules: - diff == StyleDifferenceEqual (&& !context) => diff.hasNoChange() - diff == StyleDifferenceRepaint => diff.needsRepaintObjectOnly() - diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff >= StyleDifferenceRepaint => diff.needsRepaint() || diff.needsLayout() - diff >= StyleDifferenceRepaintLayer => diff.needsRepaintLayer() || diff.needsLayout() - diff > StyleDifferenceRepaintLayer => diff.needsLayout() - diff == StyleDifferencePositionedMovementLayoutOnly => diff.needsPositionedMovementLayoutOnly() - diff == StyleDifferenceLayout => diff.needsFullLayout() BUG=358460 TEST=All existing layout tests. [email protected], [email protected], [email protected] Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171983 Review URL: https://codereview.chromium.org/236203020 git-svn-id: svn://svn.chromium.org/blink/trunk@172331 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void RenderBlock::updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* currentChild) { RenderObject* firstLetter = currentChild->parent(); RenderObject* firstLetterContainer = firstLetter->parent(); RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer); ASSERT(firstLetter->isFloating() || firstLetter->isInline()); if (RenderStyle::stylePropagationDiff(firstLetter->style(), pseudoStyle) == Reattach) { RenderBoxModelObject* newFirstLetter; if (pseudoStyle->display() == INLINE) newFirstLetter = RenderInline::createAnonymous(&document()); else newFirstLetter = RenderBlockFlow::createAnonymous(&document()); newFirstLetter->setStyle(pseudoStyle); LayoutStateDisabler layoutStateDisabler(*this); while (RenderObject* child = firstLetter->firstChild()) { if (child->isText()) toRenderText(child)->removeAndDestroyTextBoxes(); firstLetter->removeChild(child); newFirstLetter->addChild(child, 0); } RenderObject* nextSibling = firstLetter->nextSibling(); if (RenderTextFragment* remainingText = toRenderBoxModelObject(firstLetter)->firstLetterRemainingText()) { ASSERT(remainingText->isAnonymous() || remainingText->node()->renderer() == remainingText); remainingText->setFirstLetter(newFirstLetter); newFirstLetter->setFirstLetterRemainingText(remainingText); } firstLetterContainer->virtualChildren()->removeChildNode(firstLetterContainer, firstLetter); firstLetter->destroy(); firstLetter = newFirstLetter; firstLetterContainer->addChild(firstLetter, nextSibling); } else firstLetter->setStyle(pseudoStyle); for (RenderObject* genChild = firstLetter->firstChild(); genChild; genChild = genChild->nextSibling()) { if (genChild->isText()) genChild->setStyle(pseudoStyle); } }
void RenderBlock::updateFirstLetterStyle(RenderObject* firstLetterBlock, RenderObject* currentChild) { RenderObject* firstLetter = currentChild->parent(); RenderObject* firstLetterContainer = firstLetter->parent(); RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLetterContainer); ASSERT(firstLetter->isFloating() || firstLetter->isInline()); if (RenderStyle::stylePropagationDiff(firstLetter->style(), pseudoStyle) == Reattach) { RenderBoxModelObject* newFirstLetter; if (pseudoStyle->display() == INLINE) newFirstLetter = RenderInline::createAnonymous(&document()); else newFirstLetter = RenderBlockFlow::createAnonymous(&document()); newFirstLetter->setStyle(pseudoStyle); LayoutStateDisabler layoutStateDisabler(*this); while (RenderObject* child = firstLetter->firstChild()) { if (child->isText()) toRenderText(child)->removeAndDestroyTextBoxes(); firstLetter->removeChild(child); newFirstLetter->addChild(child, 0); } RenderObject* nextSibling = firstLetter->nextSibling(); if (RenderTextFragment* remainingText = toRenderBoxModelObject(firstLetter)->firstLetterRemainingText()) { ASSERT(remainingText->isAnonymous() || remainingText->node()->renderer() == remainingText); remainingText->setFirstLetter(newFirstLetter); newFirstLetter->setFirstLetterRemainingText(remainingText); } firstLetterContainer->virtualChildren()->removeChildNode(firstLetterContainer, firstLetter); firstLetter->destroy(); firstLetter = newFirstLetter; firstLetterContainer->addChild(firstLetter, nextSibling); } else firstLetter->setStyle(pseudoStyle); for (RenderObject* genChild = firstLetter->firstChild(); genChild; genChild = genChild->nextSibling()) { if (genChild->isText()) genChild->setStyle(pseudoStyle); } }
C
Chrome
0
CVE-2012-5148
https://www.cvedetails.com/cve/CVE-2012-5148/
CWE-20
https://github.com/chromium/chromium/commit/e89cfcb9090e8c98129ae9160c513f504db74599
e89cfcb9090e8c98129ae9160c513f504db74599
Remove TabContents from TabStripModelObserver::TabDetachedAt. BUG=107201 TEST=no visible change Review URL: https://chromiumcodereview.appspot.com/11293205 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167122 0039d316-1c4b-4281-b951-d872f2087c98
void BrowserWindowGtk::ShowAvatarBubbleFromAvatarButton() { if (titlebar_->avatar_button()) titlebar_->avatar_button()->ShowAvatarBubble(); }
void BrowserWindowGtk::ShowAvatarBubbleFromAvatarButton() { if (titlebar_->avatar_button()) titlebar_->avatar_button()->ShowAvatarBubble(); }
C
Chrome
0
CVE-2017-6345
https://www.cvedetails.com/cve/CVE-2017-6345/
CWE-20
https://github.com/torvalds/linux/commit/8b74d439e1697110c5e5c600643e823eb1dd0762
8b74d439e1697110c5e5c600643e823eb1dd0762
net/llc: avoid BUG_ON() in skb_orphan() It seems nobody used LLC since linux-3.12. Fortunately fuzzers like syzkaller still know how to run this code, otherwise it would be no fun. Setting skb->sk without skb->destructor leads to all kinds of bugs, we now prefer to be very strict about it. Ideally here we would use skb_set_owner() but this helper does not exist yet, only CAN seems to have a private helper for that. Fixes: 376c7311bdb6 ("net: add a temporary sanity check in skb_orphan()") Signed-off-by: Eric Dumazet <[email protected]> Reported-by: Andrey Konovalov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static struct sock *llc_lookup_listener(struct llc_sap *sap, struct llc_addr *laddr) { static struct llc_addr null_addr; struct sock *rc = __llc_lookup_listener(sap, laddr); if (!rc) rc = __llc_lookup_listener(sap, &null_addr); return rc; }
static struct sock *llc_lookup_listener(struct llc_sap *sap, struct llc_addr *laddr) { static struct llc_addr null_addr; struct sock *rc = __llc_lookup_listener(sap, laddr); if (!rc) rc = __llc_lookup_listener(sap, &null_addr); return rc; }
C
linux
0
CVE-2017-5083
https://www.cvedetails.com/cve/CVE-2017-5083/
CWE-20
https://github.com/chromium/chromium/commit/ba7ddcc38946b51a38ab017afaeb013fb038d61c
ba7ddcc38946b51a38ab017afaeb013fb038d61c
Add feature and flag to enable incognito Chrome Custom Tabs kCCTIncognito feature and flag are added to enable/disable incognito Chrome Custom Tabs. The default is set to disabled. Bug: 1023759 Change-Id: If32d256e3e9eaa94bcc09f7538c85e2dab53c589 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911201 Reviewed-by: Peter Conn <[email protected]> Reviewed-by: David Trainor <[email protected]> Commit-Queue: Ramin Halavati <[email protected]> Cr-Commit-Position: refs/heads/master@{#714849}
bool SkipConditionalFeatureEntry(const FeatureEntry& entry) { version_info::Channel channel = chrome::GetChannel(); #if defined(OS_CHROMEOS) if (!strcmp("mash", entry.internal_name) && channel == version_info::Channel::STABLE) { return true; } if (!strcmp(ui_devtools::switches::kEnableUiDevTools, entry.internal_name) && channel == version_info::Channel::STABLE) { return true; } #endif // defined(OS_CHROMEOS) if ((!strcmp("data-reduction-proxy-lo-fi", entry.internal_name) || !strcmp("enable-data-reduction-proxy-lite-page", entry.internal_name)) && channel != version_info::Channel::BETA && channel != version_info::Channel::DEV && channel != version_info::Channel::CANARY && channel != version_info::Channel::UNKNOWN) { return true; } #if defined(OS_WIN) if (!strcmp("enable-hdr", entry.internal_name) && base::win::GetVersion() < base::win::Version::WIN10) { return true; } #endif // OS_WIN if (!strcmp("dns-over-https", entry.internal_name) && chrome_browser_net::ShouldDisableDohForManaged()) { return true; } if (flags::IsFlagExpired(entry.internal_name)) return true; return false; }
bool SkipConditionalFeatureEntry(const FeatureEntry& entry) { version_info::Channel channel = chrome::GetChannel(); #if defined(OS_CHROMEOS) if (!strcmp("mash", entry.internal_name) && channel == version_info::Channel::STABLE) { return true; } if (!strcmp(ui_devtools::switches::kEnableUiDevTools, entry.internal_name) && channel == version_info::Channel::STABLE) { return true; } #endif // defined(OS_CHROMEOS) if ((!strcmp("data-reduction-proxy-lo-fi", entry.internal_name) || !strcmp("enable-data-reduction-proxy-lite-page", entry.internal_name)) && channel != version_info::Channel::BETA && channel != version_info::Channel::DEV && channel != version_info::Channel::CANARY && channel != version_info::Channel::UNKNOWN) { return true; } #if defined(OS_WIN) if (!strcmp("enable-hdr", entry.internal_name) && base::win::GetVersion() < base::win::Version::WIN10) { return true; } #endif // OS_WIN if (!strcmp("dns-over-https", entry.internal_name) && chrome_browser_net::ShouldDisableDohForManaged()) { return true; } if (flags::IsFlagExpired(entry.internal_name)) return true; return false; }
C
Chrome
0
CVE-2018-18339
https://www.cvedetails.com/cve/CVE-2018-18339/
CWE-119
https://github.com/chromium/chromium/commit/e34e01b1b0987e418bc22e3ef1cf2e4ecaead264
e34e01b1b0987e418bc22e3ef1cf2e4ecaead264
[scheduler] Remove implicit fallthrough in switch Bail out early when a condition in the switch is fulfilled. This does not change behaviour due to RemoveTaskObserver being no-op when the task observer is not present in the list. [email protected] Bug: 177475 Change-Id: Ibc7772c79f8a8c8a1d63a997dabe1efda5d3a7bd Reviewed-on: https://chromium-review.googlesource.com/891187 Reviewed-by: Nico Weber <[email protected]> Commit-Queue: Alexander Timin <[email protected]> Cr-Commit-Position: refs/heads/master@{#532649}
RendererSchedulerImpl::InputTaskRunner() { helper_.CheckOnValidThread(); return input_task_queue_; }
RendererSchedulerImpl::InputTaskRunner() { helper_.CheckOnValidThread(); return input_task_queue_; }
C
Chrome
0
CVE-2015-5697
https://www.cvedetails.com/cve/CVE-2015-5697/
CWE-200
https://github.com/torvalds/linux/commit/b6878d9e03043695dbf3fa1caa6dfc09db225b16
b6878d9e03043695dbf3fa1caa6dfc09db225b16
md: use kzalloc() when bitmap is disabled In drivers/md/md.c get_bitmap_file() uses kmalloc() for creating a mdu_bitmap_file_t called "file". 5769 file = kmalloc(sizeof(*file), GFP_NOIO); 5770 if (!file) 5771 return -ENOMEM; This structure is copied to user space at the end of the function. 5786 if (err == 0 && 5787 copy_to_user(arg, file, sizeof(*file))) 5788 err = -EFAULT But if bitmap is disabled only the first byte of "file" is initialized with zero, so it's possible to read some bytes (up to 4095) of kernel space memory from user space. This is an information leak. 5775 /* bitmap disabled, zero the first byte and copy out */ 5776 if (!mddev->bitmap_info.file) 5777 file->pathname[0] = '\0'; Signed-off-by: Benjamin Randazzo <[email protected]> Signed-off-by: NeilBrown <[email protected]>
array_size_store(struct mddev *mddev, const char *buf, size_t len) { sector_t sectors; int err; err = mddev_lock(mddev); if (err) return err; if (strncmp(buf, "default", 7) == 0) { if (mddev->pers) sectors = mddev->pers->size(mddev, 0, 0); else sectors = mddev->array_sectors; mddev->external_size = 0; } else { if (strict_blocks_to_sectors(buf, &sectors) < 0) err = -EINVAL; else if (mddev->pers && mddev->pers->size(mddev, 0, 0) < sectors) err = -E2BIG; else mddev->external_size = 1; } if (!err) { mddev->array_sectors = sectors; if (mddev->pers) { set_capacity(mddev->gendisk, mddev->array_sectors); revalidate_disk(mddev->gendisk); } } mddev_unlock(mddev); return err ?: len; }
array_size_store(struct mddev *mddev, const char *buf, size_t len) { sector_t sectors; int err; err = mddev_lock(mddev); if (err) return err; if (strncmp(buf, "default", 7) == 0) { if (mddev->pers) sectors = mddev->pers->size(mddev, 0, 0); else sectors = mddev->array_sectors; mddev->external_size = 0; } else { if (strict_blocks_to_sectors(buf, &sectors) < 0) err = -EINVAL; else if (mddev->pers && mddev->pers->size(mddev, 0, 0) < sectors) err = -E2BIG; else mddev->external_size = 1; } if (!err) { mddev->array_sectors = sectors; if (mddev->pers) { set_capacity(mddev->gendisk, mddev->array_sectors); revalidate_disk(mddev->gendisk); } } mddev_unlock(mddev); return err ?: len; }
C
linux
0
CVE-2016-5216
https://www.cvedetails.com/cve/CVE-2016-5216/
CWE-416
https://github.com/chromium/chromium/commit/bf6a6765d44b09c64b8c75d749efb84742a250e7
bf6a6765d44b09c64b8c75d749efb84742a250e7
[pdf] Defer page unloading in JS callback. One of the callbacks from PDFium JavaScript into the embedder is to get the current page number. In Chromium, this will trigger a call to CalculateMostVisiblePage that method will determine the visible pages and unload any non-visible pages. But, if the originating JS is on a non-visible page we'll delete the page and annotations associated with that page. This will cause issues as we are currently working with those objects when the JavaScript returns. This Cl defers the page unloading triggered by getting the most visible page until the next event is handled by the Chromium embedder. BUG=chromium:653090 Review-Url: https://codereview.chromium.org/2418533002 Cr-Commit-Position: refs/heads/master@{#424781}
pp::Rect PDFiumEngine::GetPageContentsRect(int index) { return GetScreenRect(pages_[index]->rect()); }
pp::Rect PDFiumEngine::GetPageContentsRect(int index) { return GetScreenRect(pages_[index]->rect()); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/4f1f3d0f03c79ddaace56f067cf28a27f9466b7d
4f1f3d0f03c79ddaace56f067cf28a27f9466b7d
Improve handling and testing of reparse points. BUG=28804 TEST=unit tests. Review URL: http://codereview.chromium.org/553080 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37286 0039d316-1c4b-4281-b951-d872f2087c98
DWORD IsReparsePoint(const std::wstring& full_path, bool* result) { std::wstring path = full_path; if (0 == path.compare(0, kNTPrefixLen, kNTPrefix)) path = path.substr(kNTPrefixLen); if (IsPipe(path)) { *result = FALSE; return ERROR_SUCCESS; } std::wstring::size_type last_pos = std::wstring::npos; do { path = path.substr(0, last_pos); DWORD attributes = ::GetFileAttributes(path.c_str()); if (INVALID_FILE_ATTRIBUTES == attributes) { DWORD error = ::GetLastError(); if (error != ERROR_FILE_NOT_FOUND && error != ERROR_PATH_NOT_FOUND && error != ERROR_INVALID_NAME) { NOTREACHED(); return error; } } else if (FILE_ATTRIBUTE_REPARSE_POINT & attributes) { *result = true; return ERROR_SUCCESS; } last_pos = path.rfind(L'\\'); } while (last_pos != std::wstring::npos); *result = false; return ERROR_SUCCESS; }
DWORD IsReparsePoint(const std::wstring& full_path, bool* result) { std::wstring path = full_path; if (0 == path.compare(0, kNTPrefixLen, kNTPrefix)) path = path.substr(kNTPrefixLen); const wchar_t kPipe[] = L"pipe\\"; if (0 == path.compare(0, arraysize(kPipe) - 1, kPipe)) { *result = FALSE; return ERROR_SUCCESS; } std::wstring::size_type last_pos = std::wstring::npos; do { path = path.substr(0, last_pos); DWORD attributes = ::GetFileAttributes(path.c_str()); if (INVALID_FILE_ATTRIBUTES == attributes) { DWORD error = ::GetLastError(); if (error != ERROR_FILE_NOT_FOUND && error != ERROR_PATH_NOT_FOUND && error != ERROR_INVALID_NAME) { NOTREACHED(); return error; } } else if (FILE_ATTRIBUTE_REPARSE_POINT & attributes) { *result = true; return ERROR_SUCCESS; } last_pos = path.rfind(L'\\'); } while (last_pos != std::wstring::npos); *result = false; return ERROR_SUCCESS; }
C
Chrome
1
CVE-2016-10165
https://www.cvedetails.com/cve/CVE-2016-10165/
CWE-125
https://github.com/mm2/Little-CMS/commit/5ca71a7bc18b6897ab21d815d15e218e204581e2
5ca71a7bc18b6897ab21d815d15e218e204581e2
Added an extra check to MLU bounds Thanks to Ibrahim el-sayed for spotting the bug
cmsTagTypeSignature DecideCurveType(cmsFloat64Number ICCVersion, const void *Data) { cmsToneCurve* Curve = (cmsToneCurve*) Data; if (ICCVersion < 4.0) return cmsSigCurveType; if (Curve ->nSegments != 1) return cmsSigCurveType; // Only 1-segment curves can be saved as parametric if (Curve ->Segments[0].Type < 0) return cmsSigCurveType; // Only non-inverted curves if (Curve ->Segments[0].Type > 5) return cmsSigCurveType; // Only ICC parametric curves return cmsSigParametricCurveType; }
cmsTagTypeSignature DecideCurveType(cmsFloat64Number ICCVersion, const void *Data) { cmsToneCurve* Curve = (cmsToneCurve*) Data; if (ICCVersion < 4.0) return cmsSigCurveType; if (Curve ->nSegments != 1) return cmsSigCurveType; // Only 1-segment curves can be saved as parametric if (Curve ->Segments[0].Type < 0) return cmsSigCurveType; // Only non-inverted curves if (Curve ->Segments[0].Type > 5) return cmsSigCurveType; // Only ICC parametric curves return cmsSigParametricCurveType; }
C
Little-CMS
0
null
null
null
https://github.com/chromium/chromium/commit/a3987c8b93d3abbba6ea4e438493bf996fff66b7
a3987c8b93d3abbba6ea4e438493bf996fff66b7
Make Surface creation lazy for OffscreenCanvasFrameReceiverImpl This CL shifts the SurfaceFactory pointer and SurfaceFactoryClient implementation from OffscreenCanvasSurfaceImpl to OffscreenCanvasFrameReceiverImpl to facilitate resource handling after compositor frame is submitted. As a result, surface on browser is lazily created (only happened on the first commit()). BUG=563852 Review-Url: https://codereview.chromium.org/2333133003 Cr-Commit-Position: refs/heads/master@{#418402}
CanvasSurfaceLayerBridge* surfaceLayerBridge() const { return m_surfaceLayerBridge.get(); }
CanvasSurfaceLayerBridge* surfaceLayerBridge() const { return m_surfaceLayerBridge.get(); }
C
Chrome
0
CVE-2013-2857
https://www.cvedetails.com/cve/CVE-2013-2857/
CWE-416
https://github.com/chromium/chromium/commit/7d085fbb43b21e959900b94f191588fd10546a94
7d085fbb43b21e959900b94f191588fd10546a94
Error event was fired synchronously blowing away the input element from underneath. Remove the FIXME and fire it asynchronously using errorEventSender(). BUG=240124 Review URL: https://chromiumcodereview.appspot.com/14741011 git-svn-id: svn://svn.chromium.org/blink/trunk@150232 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void ImageLoader::dispatchPendingLoadEvent() { if (!m_hasPendingLoadEvent) return; if (!m_image) return; m_hasPendingLoadEvent = false; if (element()->document()->attached()) dispatchLoadEvent(); updatedHasPendingEvent(); }
void ImageLoader::dispatchPendingLoadEvent() { if (!m_hasPendingLoadEvent) return; if (!m_image) return; m_hasPendingLoadEvent = false; if (element()->document()->attached()) dispatchLoadEvent(); updatedHasPendingEvent(); }
C
Chrome
0
CVE-2011-2350
https://www.cvedetails.com/cve/CVE-2011-2350/
CWE-20
https://github.com/chromium/chromium/commit/b944f670bb7a8a919daac497a4ea0536c954c201
b944f670bb7a8a919daac497a4ea0536c954c201
[JSC] Implement a helper method createNotEnoughArgumentsError() https://bugs.webkit.org/show_bug.cgi?id=85102 Reviewed by Geoffrey Garen. In bug 84787, kbr@ requested to avoid hard-coding createTypeError(exec, "Not enough arguments") here and there. This patch implements createNotEnoughArgumentsError(exec) and uses it in JSC bindings. c.f. a corresponding bug for V8 bindings is bug 85097. Source/JavaScriptCore: * runtime/Error.cpp: (JSC::createNotEnoughArgumentsError): (JSC): * runtime/Error.h: (JSC): Source/WebCore: Test: bindings/scripts/test/TestObj.idl * bindings/scripts/CodeGeneratorJS.pm: Modified as described above. (GenerateArgumentsCountCheck): * bindings/js/JSDataViewCustom.cpp: Ditto. (WebCore::getDataViewMember): (WebCore::setDataViewMember): * bindings/js/JSDeprecatedPeerConnectionCustom.cpp: (WebCore::JSDeprecatedPeerConnectionConstructor::constructJSDeprecatedPeerConnection): * bindings/js/JSDirectoryEntryCustom.cpp: (WebCore::JSDirectoryEntry::getFile): (WebCore::JSDirectoryEntry::getDirectory): * bindings/js/JSSharedWorkerCustom.cpp: (WebCore::JSSharedWorkerConstructor::constructJSSharedWorker): * bindings/js/JSWebKitMutationObserverCustom.cpp: (WebCore::JSWebKitMutationObserverConstructor::constructJSWebKitMutationObserver): (WebCore::JSWebKitMutationObserver::observe): * bindings/js/JSWorkerCustom.cpp: (WebCore::JSWorkerConstructor::constructJSWorker): * bindings/scripts/test/JS/JSFloat64Array.cpp: Updated run-bindings-tests. (WebCore::jsFloat64ArrayPrototypeFunctionFoo): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction): (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage): * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp: (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction): * bindings/scripts/test/JS/JSTestEventTarget.cpp: (WebCore::jsTestEventTargetPrototypeFunctionItem): (WebCore::jsTestEventTargetPrototypeFunctionAddEventListener): (WebCore::jsTestEventTargetPrototypeFunctionRemoveEventListener): (WebCore::jsTestEventTargetPrototypeFunctionDispatchEvent): * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::JSTestInterfaceConstructor::constructJSTestInterface): (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2): * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod): * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::constructJSTestObj): (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionIntMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithSequenceArg): (WebCore::jsTestObjPrototypeFunctionMethodReturningSequence): (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows): (WebCore::jsTestObjPrototypeFunctionSerializedValue): (WebCore::jsTestObjPrototypeFunctionIdbKey): (WebCore::jsTestObjPrototypeFunctionOptionsObject): (WebCore::jsTestObjPrototypeFunctionAddEventListener): (WebCore::jsTestObjPrototypeFunctionRemoveEventListener): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs): (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg): (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6): (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7): (WebCore::jsTestObjConstructorFunctionClassMethod2): (WebCore::jsTestObjConstructorFunctionOverloadedMethod11): (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongArray): (WebCore::jsTestObjPrototypeFunctionConvert1): (WebCore::jsTestObjPrototypeFunctionConvert2): (WebCore::jsTestObjPrototypeFunctionConvert3): (WebCore::jsTestObjPrototypeFunctionConvert4): (WebCore::jsTestObjPrototypeFunctionConvert5): (WebCore::jsTestObjPrototypeFunctionStrictFunction): * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: (WebCore::JSTestSerializedScriptValueInterfaceConstructor::constructJSTestSerializedScriptValueInterface): (WebCore::jsTestSerializedScriptValueInterfacePrototypeFunctionAcceptTransferList): git-svn-id: svn://svn.chromium.org/blink/trunk@115536 bbb929c8-8fbe-4397-9dbb-9b2b20218538
void setJSTestSerializedScriptValueInterfaceValue(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject); TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl()); impl->setValue(SerializedScriptValue::create(exec, value)); }
void setJSTestSerializedScriptValueInterfaceValue(ExecState* exec, JSObject* thisObject, JSValue value) { JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(thisObject); TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl()); impl->setValue(SerializedScriptValue::create(exec, value)); }
C
Chrome
0
null
null
null
https://github.com/chromium/chromium/commit/93dd81929416a0170935e6eeac03d10aed60df18
93dd81929416a0170935e6eeac03d10aed60df18
Implement NPN_RemoveProperty https://bugs.webkit.org/show_bug.cgi?id=43315 Reviewed by Sam Weinig. WebKit2: * WebProcess/Plugins/NPJSObject.cpp: (WebKit::NPJSObject::removeProperty): Try to remove the property. (WebKit::NPJSObject::npClass): Add NP_RemoveProperty. (WebKit::NPJSObject::NP_RemoveProperty): Call NPJSObject::removeProperty. * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp: (WebKit::NPN_RemoveProperty): Call the NPClass::removeProperty function. WebKitTools: * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj: Add NPRuntimeRemoveProperty.cpp * DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp: (PluginTest::NPN_GetStringIdentifier): (PluginTest::NPN_GetIntIdentifier): (PluginTest::NPN_RemoveProperty): Add NPN_ helpers. * DumpRenderTree/TestNetscapePlugIn/PluginTest.h: Support more NPClass functions. * DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp: Added. (NPRuntimeRemoveProperty::NPRuntimeRemoveProperty): Test for NPN_RemoveProperty. (NPRuntimeRemoveProperty::TestObject::hasMethod): (NPRuntimeRemoveProperty::TestObject::invoke): Add a testRemoveProperty method. (NPRuntimeRemoveProperty::NPP_GetValue): Return the test object. * DumpRenderTree/TestNetscapePlugIn/win/TestNetscapePlugin.vcproj: * DumpRenderTree/qt/TestNetscapePlugin/TestNetscapePlugin.pro: * GNUmakefile.am: Add NPRuntimeRemoveProperty.cpp LayoutTests: Add a test for NPN_RemoveProperty. * plugins/npruntime/remove-property-expected.txt: Added. * plugins/npruntime/remove-property.html: Added. git-svn-id: svn://svn.chromium.org/blink/trunk@64444 bbb929c8-8fbe-4397-9dbb-9b2b20218538
static NPError NPN_GetURL(NPP npp, const char* url, const char* target) { if (!url) return NPERR_GENERIC_ERROR; RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); plugin->loadURL("GET", makeURLString(url), target, HTTPHeaderMap(), Vector<char>(), false, 0); return NPERR_GENERIC_ERROR; }
static NPError NPN_GetURL(NPP npp, const char* url, const char* target) { if (!url) return NPERR_GENERIC_ERROR; RefPtr<NetscapePlugin> plugin = NetscapePlugin::fromNPP(npp); plugin->loadURL("GET", makeURLString(url), target, HTTPHeaderMap(), Vector<char>(), false, 0); return NPERR_GENERIC_ERROR; }
C
Chrome
0
CVE-2011-3101
https://www.cvedetails.com/cve/CVE-2011-3101/
null
https://github.com/chromium/chromium/commit/8f0b86c2fc77fca1508d81314f864011abe25f04
8f0b86c2fc77fca1508d81314f864011abe25f04
Always write data to new buffer in SimulateAttrib0 This is to work around linux nvidia driver bug. TEST=asan BUG=118970 Review URL: http://codereview.chromium.org/10019003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131538 0039d316-1c4b-4281-b951-d872f2087c98
void GLES2DecoderImpl::DoTexParameterfv( GLenum target, GLenum pname, const GLfloat* params) { TextureManager::TextureInfo* info = GetTextureInfoForTarget(target); if (!info) { SetGLError(GL_INVALID_VALUE, "glTexParameterfv: unknown texture"); return; } if (!texture_manager()->SetParameter( info, pname, static_cast<GLint>(params[0]))) { SetGLError(GL_INVALID_ENUM, "glTexParameterfv: param GL_INVALID_ENUM"); return; } glTexParameterfv(target, pname, params); }
void GLES2DecoderImpl::DoTexParameterfv( GLenum target, GLenum pname, const GLfloat* params) { TextureManager::TextureInfo* info = GetTextureInfoForTarget(target); if (!info) { SetGLError(GL_INVALID_VALUE, "glTexParameterfv: unknown texture"); return; } if (!texture_manager()->SetParameter( info, pname, static_cast<GLint>(params[0]))) { SetGLError(GL_INVALID_ENUM, "glTexParameterfv: param GL_INVALID_ENUM"); return; } glTexParameterfv(target, pname, params); }
C
Chrome
0
CVE-2014-3191
https://www.cvedetails.com/cve/CVE-2014-3191/
CWE-416
https://github.com/chromium/chromium/commit/11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
11a4cc4a6d6e665d9a118fada4b7c658d6f70d95
Defer call to updateWidgetPositions() outside of RenderLayerScrollableArea. updateWidgetPositions() can destroy the render tree, so it should never be called from inside RenderLayerScrollableArea. Leaving it there allows for the potential of use-after-free bugs. BUG=402407 [email protected] Review URL: https://codereview.chromium.org/490473003 git-svn-id: svn://svn.chromium.org/blink/trunk@180681 bbb929c8-8fbe-4397-9dbb-9b2b20218538
IntPoint FrameView::convertFromRenderer(const RenderObject& renderer, const IntPoint& rendererPoint) const { IntPoint point = roundedIntPoint(renderer.localToAbsolute(rendererPoint, UseTransforms)); point.moveBy(-scrollPosition()); return point; }
IntPoint FrameView::convertFromRenderer(const RenderObject& renderer, const IntPoint& rendererPoint) const { IntPoint point = roundedIntPoint(renderer.localToAbsolute(rendererPoint, UseTransforms)); point.moveBy(-scrollPosition()); return point; }
C
Chrome
0
CVE-2011-4621
https://www.cvedetails.com/cve/CVE-2011-4621/
null
https://github.com/torvalds/linux/commit/f26f9aff6aaf67e9a430d16c266f91b13a5bff64
f26f9aff6aaf67e9a430d16c266f91b13a5bff64
Sched: fix skip_clock_update optimization idle_balance() drops/retakes rq->lock, leaving the previous task vulnerable to set_tsk_need_resched(). Clear it after we return from balancing instead, and in setup_thread_stack() as well, so no successfully descheduled or never scheduled task has it set. Need resched confused the skip_clock_update logic, which assumes that the next call to update_rq_clock() will come nearly immediately after being set. Make the optimization robust against the waking a sleeper before it sucessfully deschedules case by checking that the current task has not been dequeued before setting the flag, since it is that useless clock update we're trying to save, and clear unconditionally in schedule() proper instead of conditionally in put_prev_task(). Signed-off-by: Mike Galbraith <[email protected]> Reported-by: Bjoern B. Brandenburg <[email protected]> Tested-by: Yong Zhang <[email protected]> Signed-off-by: Peter Zijlstra <[email protected]> Cc: [email protected] LKML-Reference: <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
static inline void register_rt_sched_group(struct task_group *tg, int cpu) { list_add_rcu(&tg->rt_rq[cpu]->leaf_rt_rq_list, &cpu_rq(cpu)->leaf_rt_rq_list); }
static inline void register_rt_sched_group(struct task_group *tg, int cpu) { list_add_rcu(&tg->rt_rq[cpu]->leaf_rt_rq_list, &cpu_rq(cpu)->leaf_rt_rq_list); }
C
linux
0
CVE-2014-3171
https://www.cvedetails.com/cve/CVE-2014-3171/
null
https://github.com/chromium/chromium/commit/d10a8dac48d3a9467e81c62cb45208344f4542db
d10a8dac48d3a9467e81c62cb45208344f4542db
Replace further questionable HashMap::add usages in bindings BUG=390928 [email protected] Review URL: https://codereview.chromium.org/411273002 git-svn-id: svn://svn.chromium.org/blink/trunk@178823 bbb929c8-8fbe-4397-9dbb-9b2b20218538
SerializedScriptValue::~SerializedScriptValue() { if (m_externallyAllocatedMemory) { ASSERT(v8::Isolate::GetCurrent()); v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_externallyAllocatedMemory); } }
SerializedScriptValue::~SerializedScriptValue() { if (m_externallyAllocatedMemory) { ASSERT(v8::Isolate::GetCurrent()); v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(-m_externallyAllocatedMemory); } }
C
Chrome
0
CVE-2017-2633
https://www.cvedetails.com/cve/CVE-2017-2633/
CWE-125
https://git.qemu.org/?p=qemu.git;a=commitdiff;h=9f64916da20eea67121d544698676295bbb105a7
9f64916da20eea67121d544698676295bbb105a7
null
static void vnc_queue_clear(VncJobQueue *q) { qemu_cond_destroy(&queue->cond); qemu_mutex_destroy(&queue->mutex); buffer_free(&queue->buffer); g_free(q); queue = NULL; /* Unset global queue */ }
static void vnc_queue_clear(VncJobQueue *q) { qemu_cond_destroy(&queue->cond); qemu_mutex_destroy(&queue->mutex); buffer_free(&queue->buffer); g_free(q); queue = NULL; /* Unset global queue */ }
C
qemu
0
CVE-2016-10066
https://www.cvedetails.com/cve/CVE-2016-10066/
CWE-119
https://github.com/ImageMagick/ImageMagick/commit/f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
f6e9d0d9955e85bdd7540b251cd50d598dacc5e6
null
static MagickBooleanType IsSIXEL(const unsigned char *magick,const size_t length) { const unsigned char *end = magick + length; if (length < 3) return(MagickFalse); if (*magick == 0x90 || (*magick == 0x1b && *++magick == 'P')) { while (++magick != end) { if (*magick == 'q') return(MagickTrue); if (!(*magick >= '0' && *magick <= '9') && *magick != ';') return(MagickFalse); } } return(MagickFalse); }
static MagickBooleanType IsSIXEL(const unsigned char *magick,const size_t length) { const unsigned char *end = magick + length; if (length < 3) return(MagickFalse); if (*magick == 0x90 || (*magick == 0x1b && *++magick == 'P')) { while (++magick != end) { if (*magick == 'q') return(MagickTrue); if (!(*magick >= '0' && *magick <= '9') && *magick != ';') return(MagickFalse); } } return(MagickFalse); }
C
ImageMagick
0
CVE-2018-6111
https://www.cvedetails.com/cve/CVE-2018-6111/
CWE-20
https://github.com/chromium/chromium/commit/3c8e4852477d5b1e2da877808c998dc57db9460f
3c8e4852477d5b1e2da877808c998dc57db9460f
DevTools: speculative fix for crash in NetworkHandler::Disable This keeps BrowserContext* and StoragePartition* instead of RenderProcessHost* in an attemp to resolve UAF of RenderProcessHost upon closure of DevTools front-end. Bug: 801117, 783067, 780694 Change-Id: I6c2cca60cc0c29f0949d189cf918769059f80c1b Reviewed-on: https://chromium-review.googlesource.com/876657 Commit-Queue: Andrey Kosyakov <[email protected]> Reviewed-by: Dmitry Gozman <[email protected]> Cr-Commit-Position: refs/heads/master@{#531157}
Response TargetHandler::SetDiscoverTargets(bool discover) { if (discover_ == discover) return Response::OK(); discover_ = discover; if (discover_) { DevToolsAgentHost::AddObserver(this); } else { DevToolsAgentHost::RemoveObserver(this); reported_hosts_.clear(); } return Response::OK(); }
Response TargetHandler::SetDiscoverTargets(bool discover) { if (discover_ == discover) return Response::OK(); discover_ = discover; if (discover_) { DevToolsAgentHost::AddObserver(this); } else { DevToolsAgentHost::RemoveObserver(this); reported_hosts_.clear(); } return Response::OK(); }
C
Chrome
0
CVE-2018-18445
https://www.cvedetails.com/cve/CVE-2018-18445/
CWE-125
https://github.com/torvalds/linux/commit/b799207e1e1816b09e7a5920fbb2d5fcf6edd681
b799207e1e1816b09e7a5920fbb2d5fcf6edd681
bpf: 32-bit RSH verification must truncate input before the ALU op When I wrote commit 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification"), I assumed that, in order to emulate 64-bit arithmetic with 32-bit logic, it is sufficient to just truncate the output to 32 bits; and so I just moved the register size coercion that used to be at the start of the function to the end of the function. That assumption is true for almost every op, but not for 32-bit right shifts, because those can propagate information towards the least significant bit. Fix it by always truncating inputs for 32-bit ops to 32 bits. Also get rid of the coerce_reg_to_size() after the ALU op, since that has no effect. Fixes: 468f6eafa6c4 ("bpf: fix 32-bit ALU op verification") Acked-by: Daniel Borkmann <[email protected]> Signed-off-by: Jann Horn <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]>
static int check_xadd(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) { int err; if ((BPF_SIZE(insn->code) != BPF_W && BPF_SIZE(insn->code) != BPF_DW) || insn->imm != 0) { verbose(env, "BPF_XADD uses reserved fields\n"); return -EINVAL; } /* check src1 operand */ err = check_reg_arg(env, insn->src_reg, SRC_OP); if (err) return err; /* check src2 operand */ err = check_reg_arg(env, insn->dst_reg, SRC_OP); if (err) return err; if (is_pointer_value(env, insn->src_reg)) { verbose(env, "R%d leaks addr into mem\n", insn->src_reg); return -EACCES; } if (is_ctx_reg(env, insn->dst_reg) || is_pkt_reg(env, insn->dst_reg)) { verbose(env, "BPF_XADD stores into R%d %s is not allowed\n", insn->dst_reg, is_ctx_reg(env, insn->dst_reg) ? "context" : "packet"); return -EACCES; } /* check whether atomic_add can read the memory */ err = check_mem_access(env, insn_idx, insn->dst_reg, insn->off, BPF_SIZE(insn->code), BPF_READ, -1, true); if (err) return err; /* check whether atomic_add can write into the same memory */ return check_mem_access(env, insn_idx, insn->dst_reg, insn->off, BPF_SIZE(insn->code), BPF_WRITE, -1, true); }
static int check_xadd(struct bpf_verifier_env *env, int insn_idx, struct bpf_insn *insn) { int err; if ((BPF_SIZE(insn->code) != BPF_W && BPF_SIZE(insn->code) != BPF_DW) || insn->imm != 0) { verbose(env, "BPF_XADD uses reserved fields\n"); return -EINVAL; } /* check src1 operand */ err = check_reg_arg(env, insn->src_reg, SRC_OP); if (err) return err; /* check src2 operand */ err = check_reg_arg(env, insn->dst_reg, SRC_OP); if (err) return err; if (is_pointer_value(env, insn->src_reg)) { verbose(env, "R%d leaks addr into mem\n", insn->src_reg); return -EACCES; } if (is_ctx_reg(env, insn->dst_reg) || is_pkt_reg(env, insn->dst_reg)) { verbose(env, "BPF_XADD stores into R%d %s is not allowed\n", insn->dst_reg, is_ctx_reg(env, insn->dst_reg) ? "context" : "packet"); return -EACCES; } /* check whether atomic_add can read the memory */ err = check_mem_access(env, insn_idx, insn->dst_reg, insn->off, BPF_SIZE(insn->code), BPF_READ, -1, true); if (err) return err; /* check whether atomic_add can write into the same memory */ return check_mem_access(env, insn_idx, insn->dst_reg, insn->off, BPF_SIZE(insn->code), BPF_WRITE, -1, true); }
C
linux
0
CVE-2013-2871
https://www.cvedetails.com/cve/CVE-2013-2871/
CWE-20
https://github.com/chromium/chromium/commit/bb9cfb0aba25f4b13e57bdd4a9fac80ba071e7b9
bb9cfb0aba25f4b13e57bdd4a9fac80ba071e7b9
Setting input.x-webkit-speech should not cause focus change In r150866, we introduced element()->focus() in destroyShadowSubtree() to retain focus on <input> when its type attribute gets changed. But when x-webkit-speech attribute is changed, the element is detached before calling destroyShadowSubtree() and element()->focus() failed This patch moves detach() after destroyShadowSubtree() to fix the problem. BUG=243818 TEST=fast/forms/input-type-change-focusout.html NOTRY=true Review URL: https://chromiumcodereview.appspot.com/16084005 git-svn-id: svn://svn.chromium.org/blink/trunk@151444 bbb929c8-8fbe-4397-9dbb-9b2b20218538
CheckedRadioButtons* HTMLInputElement::checkedRadioButtons() const { if (!isRadioButton()) return 0; if (HTMLFormElement* formElement = form()) return &formElement->checkedRadioButtons(); if (inDocument()) return &document()->formController()->checkedRadioButtons(); return 0; }
CheckedRadioButtons* HTMLInputElement::checkedRadioButtons() const { if (!isRadioButton()) return 0; if (HTMLFormElement* formElement = form()) return &formElement->checkedRadioButtons(); if (inDocument()) return &document()->formController()->checkedRadioButtons(); return 0; }
C
Chrome
0
CVE-2015-0273
https://www.cvedetails.com/cve/CVE-2015-0273/
null
https://git.php.net/?p=php-src.git;a=commit;h=71335e6ebabc1b12c057d8017fd811892ecdfd24
71335e6ebabc1b12c057d8017fd811892ecdfd24
null
static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC) { php_timezone_obj *new_obj = NULL; php_timezone_obj *old_obj = (php_timezone_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC); zend_object_value new_ov = date_object_new_timezone_ex(old_obj->std.ce, &new_obj TSRMLS_CC); zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); if (!old_obj->initialized) { return new_ov; } new_obj->type = old_obj->type; new_obj->initialized = 1; switch (new_obj->type) { case TIMELIB_ZONETYPE_ID: new_obj->tzi.tz = old_obj->tzi.tz; break; case TIMELIB_ZONETYPE_OFFSET: new_obj->tzi.utc_offset = old_obj->tzi.utc_offset; break; case TIMELIB_ZONETYPE_ABBR: new_obj->tzi.z.utc_offset = old_obj->tzi.z.utc_offset; new_obj->tzi.z.dst = old_obj->tzi.z.dst; new_obj->tzi.z.abbr = strdup(old_obj->tzi.z.abbr); break; } return new_ov; }
static zend_object_value date_object_clone_timezone(zval *this_ptr TSRMLS_DC) { php_timezone_obj *new_obj = NULL; php_timezone_obj *old_obj = (php_timezone_obj *) zend_object_store_get_object(this_ptr TSRMLS_CC); zend_object_value new_ov = date_object_new_timezone_ex(old_obj->std.ce, &new_obj TSRMLS_CC); zend_objects_clone_members(&new_obj->std, new_ov, &old_obj->std, Z_OBJ_HANDLE_P(this_ptr) TSRMLS_CC); if (!old_obj->initialized) { return new_ov; } new_obj->type = old_obj->type; new_obj->initialized = 1; switch (new_obj->type) { case TIMELIB_ZONETYPE_ID: new_obj->tzi.tz = old_obj->tzi.tz; break; case TIMELIB_ZONETYPE_OFFSET: new_obj->tzi.utc_offset = old_obj->tzi.utc_offset; break; case TIMELIB_ZONETYPE_ABBR: new_obj->tzi.z.utc_offset = old_obj->tzi.z.utc_offset; new_obj->tzi.z.dst = old_obj->tzi.z.dst; new_obj->tzi.z.abbr = strdup(old_obj->tzi.z.abbr); break; } return new_ov; }
C
php
0
CVE-2019-11922
https://www.cvedetails.com/cve/CVE-2019-11922/
CWE-362
https://github.com/facebook/zstd/pull/1404/commits/3e5cdf1b6a85843e991d7d10f6a2567c15580da0
3e5cdf1b6a85843e991d7d10f6a2567c15580da0
fixed T36302429
static size_t ZSTD_estimateCStreamSize_internal(int compressionLevel) { ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, 0, 0); return ZSTD_estimateCStreamSize_usingCParams(cParams); }
static size_t ZSTD_estimateCStreamSize_internal(int compressionLevel) { ZSTD_compressionParameters const cParams = ZSTD_getCParams(compressionLevel, 0, 0); return ZSTD_estimateCStreamSize_usingCParams(cParams); }
C
zstd
0
CVE-2017-7374
https://www.cvedetails.com/cve/CVE-2017-7374/
CWE-416
https://github.com/torvalds/linux/commit/1b53cf9815bb4744958d41f3795d5d5a1d365e2d
1b53cf9815bb4744958d41f3795d5d5a1d365e2d
fscrypt: remove broken support for detecting keyring key revocation Filesystem encryption ostensibly supported revoking a keyring key that had been used to "unlock" encrypted files, causing those files to become "locked" again. This was, however, buggy for several reasons, the most severe of which was that when key revocation happened to be detected for an inode, its fscrypt_info was immediately freed, even while other threads could be using it for encryption or decryption concurrently. This could be exploited to crash the kernel or worse. This patch fixes the use-after-free by removing the code which detects the keyring key having been revoked, invalidated, or expired. Instead, an encrypted inode that is "unlocked" now simply remains unlocked until it is evicted from memory. Note that this is no worse than the case for block device-level encryption, e.g. dm-crypt, and it still remains possible for a privileged user to evict unused pages, inodes, and dentries by running 'sync; echo 3 > /proc/sys/vm/drop_caches', or by simply unmounting the filesystem. In fact, one of those actions was already needed anyway for key revocation to work even somewhat sanely. This change is not expected to break any applications. In the future I'd like to implement a real API for fscrypt key revocation that interacts sanely with ongoing filesystem operations --- waiting for existing operations to complete and blocking new operations, and invalidating and sanitizing key material and plaintext from the VFS caches. But this is a hard problem, and for now this bug must be fixed. This bug affected almost all versions of ext4, f2fs, and ubifs encryption, and it was potentially reachable in any kernel configured with encryption support (CONFIG_EXT4_ENCRYPTION=y, CONFIG_EXT4_FS_ENCRYPTION=y, CONFIG_F2FS_FS_ENCRYPTION=y, or CONFIG_UBIFS_FS_ENCRYPTION=y). Note that older kernels did not use the shared fs/crypto/ code, but due to the potential security implications of this bug, it may still be worthwhile to backport this fix to them. Fixes: b7236e21d55f ("ext4 crypto: reorganize how we store keys in the inode") Cc: [email protected] # v4.2+ Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Theodore Ts'o <[email protected]> Acked-by: Michael Halcrow <[email protected]>
void fscrypt_put_encryption_info(struct inode *inode, struct fscrypt_info *ci) { struct fscrypt_info *prev; if (ci == NULL) ci = ACCESS_ONCE(inode->i_crypt_info); if (ci == NULL) return; prev = cmpxchg(&inode->i_crypt_info, ci, NULL); if (prev != ci) return; put_crypt_info(ci); }
void fscrypt_put_encryption_info(struct inode *inode, struct fscrypt_info *ci) { struct fscrypt_info *prev; if (ci == NULL) ci = ACCESS_ONCE(inode->i_crypt_info); if (ci == NULL) return; prev = cmpxchg(&inode->i_crypt_info, ci, NULL); if (prev != ci) return; put_crypt_info(ci); }
C
linux
0
CVE-2016-10130
https://www.cvedetails.com/cve/CVE-2016-10130/
CWE-284
https://github.com/libgit2/libgit2/commit/9a64e62f0f20c9cf9b2e1609f037060eb2d8eb22
9a64e62f0f20c9cf9b2e1609f037060eb2d8eb22
http: check certificate validity before clobbering the error variable
static int on_headers_complete(http_parser *parser) { parser_context *ctx = (parser_context *) parser->data; http_subtransport *t = ctx->t; http_stream *s = ctx->s; git_buf buf = GIT_BUF_INIT; int error = 0, no_callback = 0, allowed_auth_types = 0; /* Both parse_header_name and parse_header_value are populated * and ready for consumption. */ if (VALUE == t->last_cb) if (on_header_ready(t) < 0) return t->parse_error = PARSE_ERROR_GENERIC; /* Capture authentication headers which may be a 401 (authentication * is not complete) or a 200 (simply informing us that auth *is* * complete.) */ if (parse_authenticate_response(&t->www_authenticate, t, &allowed_auth_types) < 0) return t->parse_error = PARSE_ERROR_GENERIC; /* Check for an authentication failure. */ if (parser->status_code == 401 && get_verb == s->verb) { if (!t->owner->cred_acquire_cb) { no_callback = 1; } else { if (allowed_auth_types) { if (t->cred) { t->cred->free(t->cred); t->cred = NULL; } error = t->owner->cred_acquire_cb(&t->cred, t->owner->url, t->connection_data.user, allowed_auth_types, t->owner->cred_acquire_payload); if (error == GIT_PASSTHROUGH) { no_callback = 1; } else if (error < 0) { t->error = error; return t->parse_error = PARSE_ERROR_EXT; } else { assert(t->cred); if (!(t->cred->credtype & allowed_auth_types)) { giterr_set(GITERR_NET, "credentials callback returned an invalid cred type"); return t->parse_error = PARSE_ERROR_GENERIC; } /* Successfully acquired a credential. */ t->parse_error = PARSE_ERROR_REPLAY; return 0; } } } if (no_callback) { giterr_set(GITERR_NET, "authentication required but no callback set"); return t->parse_error = PARSE_ERROR_GENERIC; } } /* Check for a redirect. * Right now we only permit a redirect to the same hostname. */ if ((parser->status_code == 301 || parser->status_code == 302 || (parser->status_code == 303 && get_verb == s->verb) || parser->status_code == 307) && t->location) { if (s->redirect_count >= 7) { giterr_set(GITERR_NET, "Too many redirects"); return t->parse_error = PARSE_ERROR_GENERIC; } if (gitno_connection_data_from_url(&t->connection_data, t->location, s->service_url) < 0) return t->parse_error = PARSE_ERROR_GENERIC; /* Set the redirect URL on the stream. This is a transfer of * ownership of the memory. */ if (s->redirect_url) git__free(s->redirect_url); s->redirect_url = t->location; t->location = NULL; t->connected = 0; s->redirect_count++; t->parse_error = PARSE_ERROR_REPLAY; return 0; } /* Check for a 200 HTTP status code. */ if (parser->status_code != 200) { giterr_set(GITERR_NET, "Unexpected HTTP status code: %d", parser->status_code); return t->parse_error = PARSE_ERROR_GENERIC; } /* The response must contain a Content-Type header. */ if (!t->content_type) { giterr_set(GITERR_NET, "No Content-Type header in response"); return t->parse_error = PARSE_ERROR_GENERIC; } /* The Content-Type header must match our expectation. */ if (get_verb == s->verb) git_buf_printf(&buf, "application/x-git-%s-advertisement", ctx->s->service); else git_buf_printf(&buf, "application/x-git-%s-result", ctx->s->service); if (git_buf_oom(&buf)) return t->parse_error = PARSE_ERROR_GENERIC; if (strcmp(t->content_type, git_buf_cstr(&buf))) { git_buf_free(&buf); giterr_set(GITERR_NET, "Invalid Content-Type: %s", t->content_type); return t->parse_error = PARSE_ERROR_GENERIC; } git_buf_free(&buf); return 0; }
static int on_headers_complete(http_parser *parser) { parser_context *ctx = (parser_context *) parser->data; http_subtransport *t = ctx->t; http_stream *s = ctx->s; git_buf buf = GIT_BUF_INIT; int error = 0, no_callback = 0, allowed_auth_types = 0; /* Both parse_header_name and parse_header_value are populated * and ready for consumption. */ if (VALUE == t->last_cb) if (on_header_ready(t) < 0) return t->parse_error = PARSE_ERROR_GENERIC; /* Capture authentication headers which may be a 401 (authentication * is not complete) or a 200 (simply informing us that auth *is* * complete.) */ if (parse_authenticate_response(&t->www_authenticate, t, &allowed_auth_types) < 0) return t->parse_error = PARSE_ERROR_GENERIC; /* Check for an authentication failure. */ if (parser->status_code == 401 && get_verb == s->verb) { if (!t->owner->cred_acquire_cb) { no_callback = 1; } else { if (allowed_auth_types) { if (t->cred) { t->cred->free(t->cred); t->cred = NULL; } error = t->owner->cred_acquire_cb(&t->cred, t->owner->url, t->connection_data.user, allowed_auth_types, t->owner->cred_acquire_payload); if (error == GIT_PASSTHROUGH) { no_callback = 1; } else if (error < 0) { t->error = error; return t->parse_error = PARSE_ERROR_EXT; } else { assert(t->cred); if (!(t->cred->credtype & allowed_auth_types)) { giterr_set(GITERR_NET, "credentials callback returned an invalid cred type"); return t->parse_error = PARSE_ERROR_GENERIC; } /* Successfully acquired a credential. */ t->parse_error = PARSE_ERROR_REPLAY; return 0; } } } if (no_callback) { giterr_set(GITERR_NET, "authentication required but no callback set"); return t->parse_error = PARSE_ERROR_GENERIC; } } /* Check for a redirect. * Right now we only permit a redirect to the same hostname. */ if ((parser->status_code == 301 || parser->status_code == 302 || (parser->status_code == 303 && get_verb == s->verb) || parser->status_code == 307) && t->location) { if (s->redirect_count >= 7) { giterr_set(GITERR_NET, "Too many redirects"); return t->parse_error = PARSE_ERROR_GENERIC; } if (gitno_connection_data_from_url(&t->connection_data, t->location, s->service_url) < 0) return t->parse_error = PARSE_ERROR_GENERIC; /* Set the redirect URL on the stream. This is a transfer of * ownership of the memory. */ if (s->redirect_url) git__free(s->redirect_url); s->redirect_url = t->location; t->location = NULL; t->connected = 0; s->redirect_count++; t->parse_error = PARSE_ERROR_REPLAY; return 0; } /* Check for a 200 HTTP status code. */ if (parser->status_code != 200) { giterr_set(GITERR_NET, "Unexpected HTTP status code: %d", parser->status_code); return t->parse_error = PARSE_ERROR_GENERIC; } /* The response must contain a Content-Type header. */ if (!t->content_type) { giterr_set(GITERR_NET, "No Content-Type header in response"); return t->parse_error = PARSE_ERROR_GENERIC; } /* The Content-Type header must match our expectation. */ if (get_verb == s->verb) git_buf_printf(&buf, "application/x-git-%s-advertisement", ctx->s->service); else git_buf_printf(&buf, "application/x-git-%s-result", ctx->s->service); if (git_buf_oom(&buf)) return t->parse_error = PARSE_ERROR_GENERIC; if (strcmp(t->content_type, git_buf_cstr(&buf))) { git_buf_free(&buf); giterr_set(GITERR_NET, "Invalid Content-Type: %s", t->content_type); return t->parse_error = PARSE_ERROR_GENERIC; } git_buf_free(&buf); return 0; }
C
libgit2
0
CVE-2017-12187
https://www.cvedetails.com/cve/CVE-2017-12187/
CWE-20
https://cgit.freedesktop.org/xorg/xserver/commit/?id=cad5a1050b7184d828aef9c1dd151c3ab649d37e
cad5a1050b7184d828aef9c1dd151c3ab649d37e
null
ConstructResourceBytesByResource(XID aboutClient, ConstructResourceBytesCtx *ctx) { int specIdx; for (specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) { xXResResourceIdSpec *spec = ctx->specs + specIdx; if (spec->resource) { int cid = CLIENT_ID(spec->resource); if (cid < currentMaxClients && (aboutClient == None || cid == aboutClient)) { ClientPtr client = clients[cid]; if (client) { ctx->curSpec = spec; FindAllClientResources(client, AddResourceSizeValueByResource, ctx); } } } } }
ConstructResourceBytesByResource(XID aboutClient, ConstructResourceBytesCtx *ctx) { int specIdx; for (specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) { xXResResourceIdSpec *spec = ctx->specs + specIdx; if (spec->resource) { int cid = CLIENT_ID(spec->resource); if (cid < currentMaxClients && (aboutClient == None || cid == aboutClient)) { ClientPtr client = clients[cid]; if (client) { ctx->curSpec = spec; FindAllClientResources(client, AddResourceSizeValueByResource, ctx); } } } } }
C
xserver
0
CVE-2011-4112
https://www.cvedetails.com/cve/CVE-2011-4112/
CWE-264
https://github.com/torvalds/linux/commit/550fd08c2cebad61c548def135f67aba284c6162
550fd08c2cebad61c548def135f67aba284c6162
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There are a handful of drivers that violate this assumption of course, and need to be fixed up. This patch identifies those drivers, and marks them as not being able to support the safe transmission of skbs by clearning the IFF_TX_SKB_SHARING flag in priv_flags Signed-off-by: Neil Horman <[email protected]> CC: Karsten Keil <[email protected]> CC: "David S. Miller" <[email protected]> CC: Jay Vosburgh <[email protected]> CC: Andy Gospodarek <[email protected]> CC: Patrick McHardy <[email protected]> CC: Krzysztof Halasa <[email protected]> CC: "John W. Linville" <[email protected]> CC: Greg Kroah-Hartman <[email protected]> CC: Marcel Holtmann <[email protected]> CC: Johannes Berg <[email protected]> Signed-off-by: David S. Miller <[email protected]>
static long __tun_chr_ioctl(struct file *file, unsigned int cmd, unsigned long arg, int ifreq_len) { struct tun_file *tfile = file->private_data; struct tun_struct *tun; void __user* argp = (void __user*)arg; struct sock_fprog fprog; struct ifreq ifr; int sndbuf; int vnet_hdr_sz; int ret; if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) if (copy_from_user(&ifr, argp, ifreq_len)) return -EFAULT; if (cmd == TUNGETFEATURES) { /* Currently this just means: "what IFF flags are valid?". * This is needed because we never checked for invalid flags on * TUNSETIFF. */ return put_user(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR, (unsigned int __user*)argp); } rtnl_lock(); tun = __tun_get(tfile); if (cmd == TUNSETIFF && !tun) { ifr.ifr_name[IFNAMSIZ-1] = '\0'; ret = tun_set_iff(tfile->net, file, &ifr); if (ret) goto unlock; if (copy_to_user(argp, &ifr, ifreq_len)) ret = -EFAULT; goto unlock; } ret = -EBADFD; if (!tun) goto unlock; tun_debug(KERN_INFO, tun, "tun_chr_ioctl cmd %d\n", cmd); ret = 0; switch (cmd) { case TUNGETIFF: ret = tun_get_iff(current->nsproxy->net_ns, tun, &ifr); if (ret) break; if (copy_to_user(argp, &ifr, ifreq_len)) ret = -EFAULT; break; case TUNSETNOCSUM: /* Disable/Enable checksum */ /* [unimplemented] */ tun_debug(KERN_INFO, tun, "ignored: set checksum %s\n", arg ? "disabled" : "enabled"); break; case TUNSETPERSIST: /* Disable/Enable persist mode */ if (arg) tun->flags |= TUN_PERSIST; else tun->flags &= ~TUN_PERSIST; tun_debug(KERN_INFO, tun, "persist %s\n", arg ? "enabled" : "disabled"); break; case TUNSETOWNER: /* Set owner of the device */ tun->owner = (uid_t) arg; tun_debug(KERN_INFO, tun, "owner set to %d\n", tun->owner); break; case TUNSETGROUP: /* Set group of the device */ tun->group= (gid_t) arg; tun_debug(KERN_INFO, tun, "group set to %d\n", tun->group); break; case TUNSETLINK: /* Only allow setting the type when the interface is down */ if (tun->dev->flags & IFF_UP) { tun_debug(KERN_INFO, tun, "Linktype set failed because interface is up\n"); ret = -EBUSY; } else { tun->dev->type = (int) arg; tun_debug(KERN_INFO, tun, "linktype set to %d\n", tun->dev->type); ret = 0; } break; #ifdef TUN_DEBUG case TUNSETDEBUG: tun->debug = arg; break; #endif case TUNSETOFFLOAD: ret = set_offload(tun, arg); break; case TUNSETTXFILTER: /* Can be set only for TAPs */ ret = -EINVAL; if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV) break; ret = update_filter(&tun->txflt, (void __user *)arg); break; case SIOCGIFHWADDR: /* Get hw address */ memcpy(ifr.ifr_hwaddr.sa_data, tun->dev->dev_addr, ETH_ALEN); ifr.ifr_hwaddr.sa_family = tun->dev->type; if (copy_to_user(argp, &ifr, ifreq_len)) ret = -EFAULT; break; case SIOCSIFHWADDR: /* Set hw address */ tun_debug(KERN_DEBUG, tun, "set hw address: %pM\n", ifr.ifr_hwaddr.sa_data); ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr); break; case TUNGETSNDBUF: sndbuf = tun->socket.sk->sk_sndbuf; if (copy_to_user(argp, &sndbuf, sizeof(sndbuf))) ret = -EFAULT; break; case TUNSETSNDBUF: if (copy_from_user(&sndbuf, argp, sizeof(sndbuf))) { ret = -EFAULT; break; } tun->socket.sk->sk_sndbuf = sndbuf; break; case TUNGETVNETHDRSZ: vnet_hdr_sz = tun->vnet_hdr_sz; if (copy_to_user(argp, &vnet_hdr_sz, sizeof(vnet_hdr_sz))) ret = -EFAULT; break; case TUNSETVNETHDRSZ: if (copy_from_user(&vnet_hdr_sz, argp, sizeof(vnet_hdr_sz))) { ret = -EFAULT; break; } if (vnet_hdr_sz < (int)sizeof(struct virtio_net_hdr)) { ret = -EINVAL; break; } tun->vnet_hdr_sz = vnet_hdr_sz; break; case TUNATTACHFILTER: /* Can be set only for TAPs */ ret = -EINVAL; if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV) break; ret = -EFAULT; if (copy_from_user(&fprog, argp, sizeof(fprog))) break; ret = sk_attach_filter(&fprog, tun->socket.sk); break; case TUNDETACHFILTER: /* Can be set only for TAPs */ ret = -EINVAL; if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV) break; ret = sk_detach_filter(tun->socket.sk); break; default: ret = -EINVAL; break; } unlock: rtnl_unlock(); if (tun) tun_put(tun); return ret; }
static long __tun_chr_ioctl(struct file *file, unsigned int cmd, unsigned long arg, int ifreq_len) { struct tun_file *tfile = file->private_data; struct tun_struct *tun; void __user* argp = (void __user*)arg; struct sock_fprog fprog; struct ifreq ifr; int sndbuf; int vnet_hdr_sz; int ret; if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) if (copy_from_user(&ifr, argp, ifreq_len)) return -EFAULT; if (cmd == TUNGETFEATURES) { /* Currently this just means: "what IFF flags are valid?". * This is needed because we never checked for invalid flags on * TUNSETIFF. */ return put_user(IFF_TUN | IFF_TAP | IFF_NO_PI | IFF_ONE_QUEUE | IFF_VNET_HDR, (unsigned int __user*)argp); } rtnl_lock(); tun = __tun_get(tfile); if (cmd == TUNSETIFF && !tun) { ifr.ifr_name[IFNAMSIZ-1] = '\0'; ret = tun_set_iff(tfile->net, file, &ifr); if (ret) goto unlock; if (copy_to_user(argp, &ifr, ifreq_len)) ret = -EFAULT; goto unlock; } ret = -EBADFD; if (!tun) goto unlock; tun_debug(KERN_INFO, tun, "tun_chr_ioctl cmd %d\n", cmd); ret = 0; switch (cmd) { case TUNGETIFF: ret = tun_get_iff(current->nsproxy->net_ns, tun, &ifr); if (ret) break; if (copy_to_user(argp, &ifr, ifreq_len)) ret = -EFAULT; break; case TUNSETNOCSUM: /* Disable/Enable checksum */ /* [unimplemented] */ tun_debug(KERN_INFO, tun, "ignored: set checksum %s\n", arg ? "disabled" : "enabled"); break; case TUNSETPERSIST: /* Disable/Enable persist mode */ if (arg) tun->flags |= TUN_PERSIST; else tun->flags &= ~TUN_PERSIST; tun_debug(KERN_INFO, tun, "persist %s\n", arg ? "enabled" : "disabled"); break; case TUNSETOWNER: /* Set owner of the device */ tun->owner = (uid_t) arg; tun_debug(KERN_INFO, tun, "owner set to %d\n", tun->owner); break; case TUNSETGROUP: /* Set group of the device */ tun->group= (gid_t) arg; tun_debug(KERN_INFO, tun, "group set to %d\n", tun->group); break; case TUNSETLINK: /* Only allow setting the type when the interface is down */ if (tun->dev->flags & IFF_UP) { tun_debug(KERN_INFO, tun, "Linktype set failed because interface is up\n"); ret = -EBUSY; } else { tun->dev->type = (int) arg; tun_debug(KERN_INFO, tun, "linktype set to %d\n", tun->dev->type); ret = 0; } break; #ifdef TUN_DEBUG case TUNSETDEBUG: tun->debug = arg; break; #endif case TUNSETOFFLOAD: ret = set_offload(tun, arg); break; case TUNSETTXFILTER: /* Can be set only for TAPs */ ret = -EINVAL; if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV) break; ret = update_filter(&tun->txflt, (void __user *)arg); break; case SIOCGIFHWADDR: /* Get hw address */ memcpy(ifr.ifr_hwaddr.sa_data, tun->dev->dev_addr, ETH_ALEN); ifr.ifr_hwaddr.sa_family = tun->dev->type; if (copy_to_user(argp, &ifr, ifreq_len)) ret = -EFAULT; break; case SIOCSIFHWADDR: /* Set hw address */ tun_debug(KERN_DEBUG, tun, "set hw address: %pM\n", ifr.ifr_hwaddr.sa_data); ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr); break; case TUNGETSNDBUF: sndbuf = tun->socket.sk->sk_sndbuf; if (copy_to_user(argp, &sndbuf, sizeof(sndbuf))) ret = -EFAULT; break; case TUNSETSNDBUF: if (copy_from_user(&sndbuf, argp, sizeof(sndbuf))) { ret = -EFAULT; break; } tun->socket.sk->sk_sndbuf = sndbuf; break; case TUNGETVNETHDRSZ: vnet_hdr_sz = tun->vnet_hdr_sz; if (copy_to_user(argp, &vnet_hdr_sz, sizeof(vnet_hdr_sz))) ret = -EFAULT; break; case TUNSETVNETHDRSZ: if (copy_from_user(&vnet_hdr_sz, argp, sizeof(vnet_hdr_sz))) { ret = -EFAULT; break; } if (vnet_hdr_sz < (int)sizeof(struct virtio_net_hdr)) { ret = -EINVAL; break; } tun->vnet_hdr_sz = vnet_hdr_sz; break; case TUNATTACHFILTER: /* Can be set only for TAPs */ ret = -EINVAL; if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV) break; ret = -EFAULT; if (copy_from_user(&fprog, argp, sizeof(fprog))) break; ret = sk_attach_filter(&fprog, tun->socket.sk); break; case TUNDETACHFILTER: /* Can be set only for TAPs */ ret = -EINVAL; if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV) break; ret = sk_detach_filter(tun->socket.sk); break; default: ret = -EINVAL; break; } unlock: rtnl_unlock(); if (tun) tun_put(tun); return ret; }
C
linux
0
CVE-2013-1773
https://www.cvedetails.com/cve/CVE-2013-1773/
CWE-119
https://github.com/torvalds/linux/commit/0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd
0720a06a7518c9d0c0125bd5d1f3b6264c55c3dd
NLS: improve UTF8 -> UTF16 string conversion routine The utf8s_to_utf16s conversion routine needs to be improved. Unlike its utf16s_to_utf8s sibling, it doesn't accept arguments specifying the maximum length of the output buffer or the endianness of its 16-bit output. This patch (as1501) adds the two missing arguments, and adjusts the only two places in the kernel where the function is called. A follow-on patch will add a third caller that does utilize the new capabilities. The two conversion routines are still annoyingly inconsistent in the way they handle invalid byte combinations. But that's a subject for a different patch. Signed-off-by: Alan Stern <[email protected]> CC: Clemens Ladisch <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
kvp_send_key(struct work_struct *dummy) { struct cn_msg *msg; int index = kvp_transaction.index; msg = kzalloc(sizeof(*msg) + sizeof(struct hv_kvp_msg) , GFP_ATOMIC); if (msg) { msg->id.idx = CN_KVP_IDX; msg->id.val = CN_KVP_VAL; msg->seq = KVP_KERNEL_GET; ((struct hv_ku_msg *)msg->data)->kvp_index = index; msg->len = sizeof(struct hv_ku_msg); cn_netlink_send(msg, 0, GFP_ATOMIC); kfree(msg); } return; }
kvp_send_key(struct work_struct *dummy) { struct cn_msg *msg; int index = kvp_transaction.index; msg = kzalloc(sizeof(*msg) + sizeof(struct hv_kvp_msg) , GFP_ATOMIC); if (msg) { msg->id.idx = CN_KVP_IDX; msg->id.val = CN_KVP_VAL; msg->seq = KVP_KERNEL_GET; ((struct hv_ku_msg *)msg->data)->kvp_index = index; msg->len = sizeof(struct hv_ku_msg); cn_netlink_send(msg, 0, GFP_ATOMIC); kfree(msg); } return; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/5041f984669fe3a989a84c348eb838c8f7233f6b
5041f984669fe3a989a84c348eb838c8f7233f6b
AutoFill: Release the cached frame when we receive the frameDestroyed() message from WebKit. BUG=48857 TEST=none Review URL: http://codereview.chromium.org/3173005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55789 0039d316-1c4b-4281-b951-d872f2087c98
WebWorker* RenderView::createWorker(WebFrame* frame, WebWorkerClient* client) { WebApplicationCacheHostImpl* appcache_host = WebApplicationCacheHostImpl::FromFrame(frame); int appcache_host_id = appcache_host ? appcache_host->host_id() : 0; return new WebWorkerProxy(client, RenderThread::current(), routing_id_, appcache_host_id); }
WebWorker* RenderView::createWorker(WebFrame* frame, WebWorkerClient* client) { WebApplicationCacheHostImpl* appcache_host = WebApplicationCacheHostImpl::FromFrame(frame); int appcache_host_id = appcache_host ? appcache_host->host_id() : 0; return new WebWorkerProxy(client, RenderThread::current(), routing_id_, appcache_host_id); }
C
Chrome
0
CVE-2012-2880
https://www.cvedetails.com/cve/CVE-2012-2880/
CWE-362
https://github.com/chromium/chromium/commit/fcd3a7a671ecf2d5f46ea34787d27507a914d2f5
fcd3a7a671ecf2d5f46ea34787d27507a914d2f5
[Sync] Cleanup all tab sync enabling logic now that its on by default. BUG=none TEST= Review URL: https://chromiumcodereview.appspot.com/10443046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139462 0039d316-1c4b-4281-b951-d872f2087c98
SyncSessionSnapshot SyncBackendHost::GetLastSessionSnapshot() const { return last_snapshot_; }
SyncSessionSnapshot SyncBackendHost::GetLastSessionSnapshot() const { return last_snapshot_; }
C
Chrome
0
CVE-2018-6094
https://www.cvedetails.com/cve/CVE-2018-6094/
CWE-119
https://github.com/chromium/chromium/commit/0749ec24fae74ec32d0567eef0e5ec43c84dbcb9
0749ec24fae74ec32d0567eef0e5ec43c84dbcb9
Call HeapObjectHeader::checkHeader solely for its side-effect. This requires changing its signature. This is a preliminary stage to making it private. BUG=633030 Review-Url: https://codereview.chromium.org/2698673003 Cr-Commit-Position: refs/heads/master@{#460489}
bool HeapAllocator::expandHashTableBacking(void* address, size_t newSize) { return backingExpand(address, newSize); }
bool HeapAllocator::expandHashTableBacking(void* address, size_t newSize) { return backingExpand(address, newSize); }
C
Chrome
0
CVE-2016-5222
https://www.cvedetails.com/cve/CVE-2016-5222/
CWE-20
https://github.com/chromium/chromium/commit/e4ebe078840e65d673722e94f8251b334030b5e8
e4ebe078840e65d673722e94f8251b334030b5e8
Drop navigations to NavigationEntry with invalid virtual URLs. BUG=657720 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Review-Url: https://codereview.chromium.org/2452443002 Cr-Commit-Position: refs/heads/master@{#428056}
void NavigatorImpl::DidFailProvisionalLoadWithError( RenderFrameHostImpl* render_frame_host, const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() << ", error_code: " << params.error_code << ", error_description: " << params.error_description << ", showing_repost_interstitial: " << params.showing_repost_interstitial << ", frame_id: " << render_frame_host->GetRoutingID(); GURL validated_url(params.url); RenderProcessHost* render_process_host = render_frame_host->GetProcess(); render_process_host->FilterURL(false, &validated_url); if (net::ERR_ABORTED == params.error_code) { FrameTreeNode* root = render_frame_host->frame_tree_node()->frame_tree()->root(); if (root->render_manager()->interstitial_page() != NULL) { LOG(WARNING) << "Discarding message during interstitial."; return; } } DiscardPendingEntryIfNeeded(render_frame_host->navigation_handle()); if (delegate_) { delegate_->DidFailProvisionalLoadWithError( render_frame_host, validated_url, params.error_code, params.error_description, params.was_ignored_by_handler); } }
void NavigatorImpl::DidFailProvisionalLoadWithError( RenderFrameHostImpl* render_frame_host, const FrameHostMsg_DidFailProvisionalLoadWithError_Params& params) { VLOG(1) << "Failed Provisional Load: " << params.url.possibly_invalid_spec() << ", error_code: " << params.error_code << ", error_description: " << params.error_description << ", showing_repost_interstitial: " << params.showing_repost_interstitial << ", frame_id: " << render_frame_host->GetRoutingID(); GURL validated_url(params.url); RenderProcessHost* render_process_host = render_frame_host->GetProcess(); render_process_host->FilterURL(false, &validated_url); if (net::ERR_ABORTED == params.error_code) { FrameTreeNode* root = render_frame_host->frame_tree_node()->frame_tree()->root(); if (root->render_manager()->interstitial_page() != NULL) { LOG(WARNING) << "Discarding message during interstitial."; return; } } DiscardPendingEntryIfNeeded(render_frame_host->navigation_handle()); if (delegate_) { delegate_->DidFailProvisionalLoadWithError( render_frame_host, validated_url, params.error_code, params.error_description, params.was_ignored_by_handler); } }
C
Chrome
0
CVE-2013-0904
https://www.cvedetails.com/cve/CVE-2013-0904/
CWE-119
https://github.com/chromium/chromium/commit/b2b21468c1f7f08b30a7c1755316f6026c50eb2a
b2b21468c1f7f08b30a7c1755316f6026c50eb2a
Separate repaint and layout requirements of StyleDifference (Step 1) Previously StyleDifference was an enum that proximately bigger values imply smaller values (e.g. StyleDifferenceLayout implies StyleDifferenceRepaint). This causes unnecessary repaints in some cases on layout change. Convert StyleDifference to a structure containing relatively independent flags. This change doesn't directly improve the result, but can make further repaint optimizations possible. Step 1 doesn't change any functionality. RenderStyle still generate the legacy StyleDifference enum when comparing styles and convert the result to the new StyleDifference. Implicit requirements are not handled during the conversion. Converted call sites to use the new StyleDifference according to the following conversion rules: - diff == StyleDifferenceEqual (&& !context) => diff.hasNoChange() - diff == StyleDifferenceRepaint => diff.needsRepaintObjectOnly() - diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff == StyleDifferenceRepaint || diff == StyleDifferenceRepaintLayer => diff.needsRepaintLayer() - diff >= StyleDifferenceRepaint => diff.needsRepaint() || diff.needsLayout() - diff >= StyleDifferenceRepaintLayer => diff.needsRepaintLayer() || diff.needsLayout() - diff > StyleDifferenceRepaintLayer => diff.needsLayout() - diff == StyleDifferencePositionedMovementLayoutOnly => diff.needsPositionedMovementLayoutOnly() - diff == StyleDifferenceLayout => diff.needsFullLayout() BUG=358460 TEST=All existing layout tests. [email protected], [email protected], [email protected] Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=171983 Review URL: https://codereview.chromium.org/236203020 git-svn-id: svn://svn.chromium.org/blink/trunk@172331 bbb929c8-8fbe-4397-9dbb-9b2b20218538
bool RenderBlock::hasPercentHeightContainerMap() { return gPercentHeightContainerMap; }
bool RenderBlock::hasPercentHeightContainerMap() { return gPercentHeightContainerMap; }
C
Chrome
0
CVE-2010-5313
https://www.cvedetails.com/cve/CVE-2010-5313/
CWE-362
https://github.com/torvalds/linux/commit/fc3a9157d3148ab91039c75423da8ef97be3e105
fc3a9157d3148ab91039c75423da8ef97be3e105
KVM: X86: Don't report L2 emulation failures to user-space This patch prevents that emulation failures which result from emulating an instruction for an L2-Guest results in being reported to userspace. Without this patch a malicious L2-Guest would be able to kill the L1 by triggering a race-condition between an vmexit and the instruction emulator. With this patch the L2 will most likely only kill itself in this situation. Signed-off-by: Joerg Roedel <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns) { u64 tsc = pvclock_scale_delta(kernel_ns-vcpu->arch.last_tsc_nsec, vcpu->kvm->arch.virtual_tsc_mult, vcpu->kvm->arch.virtual_tsc_shift); tsc += vcpu->arch.last_tsc_write; return tsc; }
static u64 compute_guest_tsc(struct kvm_vcpu *vcpu, s64 kernel_ns) { u64 tsc = pvclock_scale_delta(kernel_ns-vcpu->arch.last_tsc_nsec, vcpu->kvm->arch.virtual_tsc_mult, vcpu->kvm->arch.virtual_tsc_shift); tsc += vcpu->arch.last_tsc_write; return tsc; }
C
linux
0
CVE-2018-0500
https://www.cvedetails.com/cve/CVE-2018-0500/
CWE-119
https://github.com/curl/curl/commit/ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628
ba1dbd78e5f1ed67c1b8d37ac89d90e5e330b628
smtp: use the upload buffer size for scratch buffer malloc ... not the read buffer size, as that can be set smaller and thus cause a buffer overflow! CVE-2018-0500 Reported-by: Peter Wu Bug: https://curl.haxx.se/docs/adv_2018-70a2.html
static CURLcode smtp_perform_command(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; struct SMTP *smtp = data->req.protop; /* Send the command */ if(smtp->rcpt) result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s %s", smtp->custom && smtp->custom[0] != '\0' ? smtp->custom : "VRFY", smtp->rcpt->data); else result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", smtp->custom && smtp->custom[0] != '\0' ? smtp->custom : "HELP"); if(!result) state(conn, SMTP_COMMAND); return result; }
static CURLcode smtp_perform_command(struct connectdata *conn) { CURLcode result = CURLE_OK; struct Curl_easy *data = conn->data; struct SMTP *smtp = data->req.protop; /* Send the command */ if(smtp->rcpt) result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s %s", smtp->custom && smtp->custom[0] != '\0' ? smtp->custom : "VRFY", smtp->rcpt->data); else result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", smtp->custom && smtp->custom[0] != '\0' ? smtp->custom : "HELP"); if(!result) state(conn, SMTP_COMMAND); return result; }
C
curl
0
CVE-2014-4652
https://www.cvedetails.com/cve/CVE-2014-4652/
CWE-362
https://github.com/torvalds/linux/commit/07f4d9d74a04aa7c72c5dae0ef97565f28f17b92
07f4d9d74a04aa7c72c5dae0ef97565f28f17b92
ALSA: control: Protect user controls against concurrent access The user-control put and get handlers as well as the tlv do not protect against concurrent access from multiple threads. Since the state of the control is not updated atomically it is possible that either two write operations or a write and a read operation race against each other. Both can lead to arbitrary memory disclosure. This patch introduces a new lock that protects user-controls from concurrent access. Since applications typically access controls sequentially than in parallel a single lock per card should be fine. Signed-off-by: Lars-Peter Clausen <[email protected]> Acked-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
static ssize_t snd_disconnect_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) { return -ENODEV; }
static ssize_t snd_disconnect_write(struct file *file, const char __user *buf, size_t count, loff_t *offset) { return -ENODEV; }
C
linux
0
CVE-2013-0839
https://www.cvedetails.com/cve/CVE-2013-0839/
CWE-399
https://github.com/chromium/chromium/commit/dd3b6fe574edad231c01c78e4647a74c38dc4178
dd3b6fe574edad231c01c78e4647a74c38dc4178
Remove parent* arg from GDataEntry ctor. * Remove static FromDocumentEntry from GDataEntry, GDataFile, GDataDirectory. Replace with InitFromDocumentEntry. * Move common code from GDataFile::InitFromDocumentEntry and GDataDirectory::InitFromDocumentEntry to GDataEntry::InitFromDocumentEntry. * Add GDataDirectoryService::FromDocumentEntry and use this everywhere. * Make ctors of GDataFile, GDataDirectory private, so these must be created by GDataDirectoryService's CreateGDataFile and CreateGDataDirectory. Make GDataEntry ctor protected. BUG=141494 TEST=unit tests. Review URL: https://chromiumcodereview.appspot.com/10854083 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151008 0039d316-1c4b-4281-b951-d872f2087c98
FeedToFileResourceMapUmaStats::FeedToFileResourceMapUmaStats() : num_regular_files(0), num_hosted_documents(0) { }
FeedToFileResourceMapUmaStats::FeedToFileResourceMapUmaStats() : num_regular_files(0), num_hosted_documents(0) { }
C
Chrome
0
CVE-2012-2133
https://www.cvedetails.com/cve/CVE-2012-2133/
CWE-399
https://github.com/torvalds/linux/commit/90481622d75715bfcb68501280a917dbfe516029
90481622d75715bfcb68501280a917dbfe516029
hugepages: fix use after free bug in "quota" handling hugetlbfs_{get,put}_quota() are badly named. They don't interact with the general quota handling code, and they don't much resemble its behaviour. Rather than being about maintaining limits on on-disk block usage by particular users, they are instead about maintaining limits on in-memory page usage (including anonymous MAP_PRIVATE copied-on-write pages) associated with a particular hugetlbfs filesystem instance. Worse, they work by having callbacks to the hugetlbfs filesystem code from the low-level page handling code, in particular from free_huge_page(). This is a layering violation of itself, but more importantly, if the kernel does a get_user_pages() on hugepages (which can happen from KVM amongst others), then the free_huge_page() can be delayed until after the associated inode has already been freed. If an unmount occurs at the wrong time, even the hugetlbfs superblock where the "quota" limits are stored may have been freed. Andrew Barry proposed a patch to fix this by having hugepages, instead of storing a pointer to their address_space and reaching the superblock from there, had the hugepages store pointers directly to the superblock, bumping the reference count as appropriate to avoid it being freed. Andrew Morton rejected that version, however, on the grounds that it made the existing layering violation worse. This is a reworked version of Andrew's patch, which removes the extra, and some of the existing, layering violation. It works by introducing the concept of a hugepage "subpool" at the lower hugepage mm layer - that is a finite logical pool of hugepages to allocate from. hugetlbfs now creates a subpool for each filesystem instance with a page limit set, and a pointer to the subpool gets added to each allocated hugepage, instead of the address_space pointer used now. The subpool has its own lifetime and is only freed once all pages in it _and_ all other references to it (i.e. superblocks) are gone. subpools are optional - a NULL subpool pointer is taken by the code to mean that no subpool limits are in effect. Previous discussion of this bug found in: "Fix refcounting in hugetlbfs quota handling.". See: https://lkml.org/lkml/2011/8/11/28 or http://marc.info/?l=linux-mm&m=126928970510627&w=1 v2: Fixed a bug spotted by Hillf Danton, and removed the extra parameter to alloc_huge_page() - since it already takes the vma, it is not necessary. Signed-off-by: Andrew Barry <[email protected]> Signed-off-by: David Gibson <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Hillf Danton <[email protected]> Cc: Paul Mackerras <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo) { if (sbinfo->free_inodes >= 0) { spin_lock(&sbinfo->stat_lock); sbinfo->free_inodes++; spin_unlock(&sbinfo->stat_lock); } }
static void hugetlbfs_inc_free_inodes(struct hugetlbfs_sb_info *sbinfo) { if (sbinfo->free_inodes >= 0) { spin_lock(&sbinfo->stat_lock); sbinfo->free_inodes++; spin_unlock(&sbinfo->stat_lock); } }
C
linux
0
CVE-2015-6763
https://www.cvedetails.com/cve/CVE-2015-6763/
null
https://github.com/chromium/chromium/commit/f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
f1574f25e1402e748bf2bd7e28ce3dd96ceb1ca4
MacViews: Enable secure text input for password Textfields. In Cocoa the NSTextInputContext automatically enables secure text input when activated and it's in the secure text entry mode. RenderWidgetHostViewMac did the similar thing for ages following the WebKit example. views::Textfield needs to do the same thing in a fashion that's sycnrhonized with RenderWidgetHostViewMac, otherwise the race conditions are possible when the Textfield gets focus, activates the secure text input mode and the RWHVM loses focus immediately afterwards and disables the secure text input instead of leaving it in the enabled state. BUG=818133,677220 Change-Id: I6db6c4b59e4a1a72cbb7f8c7056f71b04a3df08b Reviewed-on: https://chromium-review.googlesource.com/943064 Commit-Queue: Michail Pishchagin <[email protected]> Reviewed-by: Pavel Feldman <[email protected]> Reviewed-by: Avi Drissman <[email protected]> Reviewed-by: Peter Kasting <[email protected]> Cr-Commit-Position: refs/heads/master@{#542517}
void LocalDOMWindow::AcceptLanguagesChanged() { if (navigator_) navigator_->SetLanguagesChanged(); DispatchEvent(Event::Create(EventTypeNames::languagechange)); }
void LocalDOMWindow::AcceptLanguagesChanged() { if (navigator_) navigator_->SetLanguagesChanged(); DispatchEvent(Event::Create(EventTypeNames::languagechange)); }
C
Chrome
0
CVE-2011-2793
https://www.cvedetails.com/cve/CVE-2011-2793/
CWE-399
https://github.com/chromium/chromium/commit/a6e146b4a369b31afa4c4323cc813dcbe0ef0c2b
a6e146b4a369b31afa4c4323cc813dcbe0ef0c2b
Use URLFetcher::Create instead of new in http_bridge.cc. This change modified http_bridge so that it uses a factory to construct the URLFetcher. Moreover, it modified sync_backend_host_unittest.cc to use an URLFetcher factory which will prevent access to www.example.com during the test. BUG=none TEST=sync_backend_host_unittest.cc Review URL: http://codereview.chromium.org/7053011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87227 0039d316-1c4b-4281-b951-d872f2087c98
void RunDelegate() { net::URLRequestStatus status; status.set_status(success_ ? net::URLRequestStatus::SUCCESS : net::URLRequestStatus::FAILED); delegate()->OnURLFetchComplete(this, url_, status, success_ ? 200 : 500, net::ResponseCookies(), response_data_); }
void RunDelegate() { net::URLRequestStatus status; status.set_status(success_ ? net::URLRequestStatus::SUCCESS : net::URLRequestStatus::FAILED); delegate()->OnURLFetchComplete(this, url_, status, success_ ? 200 : 500, net::ResponseCookies(), response_data_); }
C
Chrome
0
CVE-2016-4482
https://www.cvedetails.com/cve/CVE-2016-4482/
CWE-200
https://github.com/torvalds/linux/commit/681fef8380eb818c0b845fca5d2ab1dcbab114ee
681fef8380eb818c0b845fca5d2ab1dcbab114ee
USB: usbfs: fix potential infoleak in devio The stack object “ci” has a total size of 8 bytes. Its last 3 bytes are padding bytes which are not initialized and leaked to userland via “copy_to_user”. Signed-off-by: Kangjie Lu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
static long usbdev_do_ioctl(struct file *file, unsigned int cmd, void __user *p) { struct usb_dev_state *ps = file->private_data; struct inode *inode = file_inode(file); struct usb_device *dev = ps->dev; int ret = -ENOTTY; if (!(file->f_mode & FMODE_WRITE)) return -EPERM; usb_lock_device(dev); /* Reap operations are allowed even after disconnection */ switch (cmd) { case USBDEVFS_REAPURB: snoop(&dev->dev, "%s: REAPURB\n", __func__); ret = proc_reapurb(ps, p); goto done; case USBDEVFS_REAPURBNDELAY: snoop(&dev->dev, "%s: REAPURBNDELAY\n", __func__); ret = proc_reapurbnonblock(ps, p); goto done; #ifdef CONFIG_COMPAT case USBDEVFS_REAPURB32: snoop(&dev->dev, "%s: REAPURB32\n", __func__); ret = proc_reapurb_compat(ps, p); goto done; case USBDEVFS_REAPURBNDELAY32: snoop(&dev->dev, "%s: REAPURBNDELAY32\n", __func__); ret = proc_reapurbnonblock_compat(ps, p); goto done; #endif } if (!connected(ps)) { usb_unlock_device(dev); return -ENODEV; } switch (cmd) { case USBDEVFS_CONTROL: snoop(&dev->dev, "%s: CONTROL\n", __func__); ret = proc_control(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_BULK: snoop(&dev->dev, "%s: BULK\n", __func__); ret = proc_bulk(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_RESETEP: snoop(&dev->dev, "%s: RESETEP\n", __func__); ret = proc_resetep(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_RESET: snoop(&dev->dev, "%s: RESET\n", __func__); ret = proc_resetdevice(ps); break; case USBDEVFS_CLEAR_HALT: snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__); ret = proc_clearhalt(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_GETDRIVER: snoop(&dev->dev, "%s: GETDRIVER\n", __func__); ret = proc_getdriver(ps, p); break; case USBDEVFS_CONNECTINFO: snoop(&dev->dev, "%s: CONNECTINFO\n", __func__); ret = proc_connectinfo(ps, p); break; case USBDEVFS_SETINTERFACE: snoop(&dev->dev, "%s: SETINTERFACE\n", __func__); ret = proc_setintf(ps, p); break; case USBDEVFS_SETCONFIGURATION: snoop(&dev->dev, "%s: SETCONFIGURATION\n", __func__); ret = proc_setconfig(ps, p); break; case USBDEVFS_SUBMITURB: snoop(&dev->dev, "%s: SUBMITURB\n", __func__); ret = proc_submiturb(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; #ifdef CONFIG_COMPAT case USBDEVFS_CONTROL32: snoop(&dev->dev, "%s: CONTROL32\n", __func__); ret = proc_control_compat(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_BULK32: snoop(&dev->dev, "%s: BULK32\n", __func__); ret = proc_bulk_compat(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_DISCSIGNAL32: snoop(&dev->dev, "%s: DISCSIGNAL32\n", __func__); ret = proc_disconnectsignal_compat(ps, p); break; case USBDEVFS_SUBMITURB32: snoop(&dev->dev, "%s: SUBMITURB32\n", __func__); ret = proc_submiturb_compat(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_IOCTL32: snoop(&dev->dev, "%s: IOCTL32\n", __func__); ret = proc_ioctl_compat(ps, ptr_to_compat(p)); break; #endif case USBDEVFS_DISCARDURB: snoop(&dev->dev, "%s: DISCARDURB %p\n", __func__, p); ret = proc_unlinkurb(ps, p); break; case USBDEVFS_DISCSIGNAL: snoop(&dev->dev, "%s: DISCSIGNAL\n", __func__); ret = proc_disconnectsignal(ps, p); break; case USBDEVFS_CLAIMINTERFACE: snoop(&dev->dev, "%s: CLAIMINTERFACE\n", __func__); ret = proc_claiminterface(ps, p); break; case USBDEVFS_RELEASEINTERFACE: snoop(&dev->dev, "%s: RELEASEINTERFACE\n", __func__); ret = proc_releaseinterface(ps, p); break; case USBDEVFS_IOCTL: snoop(&dev->dev, "%s: IOCTL\n", __func__); ret = proc_ioctl_default(ps, p); break; case USBDEVFS_CLAIM_PORT: snoop(&dev->dev, "%s: CLAIM_PORT\n", __func__); ret = proc_claim_port(ps, p); break; case USBDEVFS_RELEASE_PORT: snoop(&dev->dev, "%s: RELEASE_PORT\n", __func__); ret = proc_release_port(ps, p); break; case USBDEVFS_GET_CAPABILITIES: ret = proc_get_capabilities(ps, p); break; case USBDEVFS_DISCONNECT_CLAIM: ret = proc_disconnect_claim(ps, p); break; case USBDEVFS_ALLOC_STREAMS: ret = proc_alloc_streams(ps, p); break; case USBDEVFS_FREE_STREAMS: ret = proc_free_streams(ps, p); break; case USBDEVFS_DROP_PRIVILEGES: ret = proc_drop_privileges(ps, p); break; } done: usb_unlock_device(dev); if (ret >= 0) inode->i_atime = CURRENT_TIME; return ret; }
static long usbdev_do_ioctl(struct file *file, unsigned int cmd, void __user *p) { struct usb_dev_state *ps = file->private_data; struct inode *inode = file_inode(file); struct usb_device *dev = ps->dev; int ret = -ENOTTY; if (!(file->f_mode & FMODE_WRITE)) return -EPERM; usb_lock_device(dev); /* Reap operations are allowed even after disconnection */ switch (cmd) { case USBDEVFS_REAPURB: snoop(&dev->dev, "%s: REAPURB\n", __func__); ret = proc_reapurb(ps, p); goto done; case USBDEVFS_REAPURBNDELAY: snoop(&dev->dev, "%s: REAPURBNDELAY\n", __func__); ret = proc_reapurbnonblock(ps, p); goto done; #ifdef CONFIG_COMPAT case USBDEVFS_REAPURB32: snoop(&dev->dev, "%s: REAPURB32\n", __func__); ret = proc_reapurb_compat(ps, p); goto done; case USBDEVFS_REAPURBNDELAY32: snoop(&dev->dev, "%s: REAPURBNDELAY32\n", __func__); ret = proc_reapurbnonblock_compat(ps, p); goto done; #endif } if (!connected(ps)) { usb_unlock_device(dev); return -ENODEV; } switch (cmd) { case USBDEVFS_CONTROL: snoop(&dev->dev, "%s: CONTROL\n", __func__); ret = proc_control(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_BULK: snoop(&dev->dev, "%s: BULK\n", __func__); ret = proc_bulk(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_RESETEP: snoop(&dev->dev, "%s: RESETEP\n", __func__); ret = proc_resetep(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_RESET: snoop(&dev->dev, "%s: RESET\n", __func__); ret = proc_resetdevice(ps); break; case USBDEVFS_CLEAR_HALT: snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__); ret = proc_clearhalt(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_GETDRIVER: snoop(&dev->dev, "%s: GETDRIVER\n", __func__); ret = proc_getdriver(ps, p); break; case USBDEVFS_CONNECTINFO: snoop(&dev->dev, "%s: CONNECTINFO\n", __func__); ret = proc_connectinfo(ps, p); break; case USBDEVFS_SETINTERFACE: snoop(&dev->dev, "%s: SETINTERFACE\n", __func__); ret = proc_setintf(ps, p); break; case USBDEVFS_SETCONFIGURATION: snoop(&dev->dev, "%s: SETCONFIGURATION\n", __func__); ret = proc_setconfig(ps, p); break; case USBDEVFS_SUBMITURB: snoop(&dev->dev, "%s: SUBMITURB\n", __func__); ret = proc_submiturb(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; #ifdef CONFIG_COMPAT case USBDEVFS_CONTROL32: snoop(&dev->dev, "%s: CONTROL32\n", __func__); ret = proc_control_compat(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_BULK32: snoop(&dev->dev, "%s: BULK32\n", __func__); ret = proc_bulk_compat(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_DISCSIGNAL32: snoop(&dev->dev, "%s: DISCSIGNAL32\n", __func__); ret = proc_disconnectsignal_compat(ps, p); break; case USBDEVFS_SUBMITURB32: snoop(&dev->dev, "%s: SUBMITURB32\n", __func__); ret = proc_submiturb_compat(ps, p); if (ret >= 0) inode->i_mtime = CURRENT_TIME; break; case USBDEVFS_IOCTL32: snoop(&dev->dev, "%s: IOCTL32\n", __func__); ret = proc_ioctl_compat(ps, ptr_to_compat(p)); break; #endif case USBDEVFS_DISCARDURB: snoop(&dev->dev, "%s: DISCARDURB %p\n", __func__, p); ret = proc_unlinkurb(ps, p); break; case USBDEVFS_DISCSIGNAL: snoop(&dev->dev, "%s: DISCSIGNAL\n", __func__); ret = proc_disconnectsignal(ps, p); break; case USBDEVFS_CLAIMINTERFACE: snoop(&dev->dev, "%s: CLAIMINTERFACE\n", __func__); ret = proc_claiminterface(ps, p); break; case USBDEVFS_RELEASEINTERFACE: snoop(&dev->dev, "%s: RELEASEINTERFACE\n", __func__); ret = proc_releaseinterface(ps, p); break; case USBDEVFS_IOCTL: snoop(&dev->dev, "%s: IOCTL\n", __func__); ret = proc_ioctl_default(ps, p); break; case USBDEVFS_CLAIM_PORT: snoop(&dev->dev, "%s: CLAIM_PORT\n", __func__); ret = proc_claim_port(ps, p); break; case USBDEVFS_RELEASE_PORT: snoop(&dev->dev, "%s: RELEASE_PORT\n", __func__); ret = proc_release_port(ps, p); break; case USBDEVFS_GET_CAPABILITIES: ret = proc_get_capabilities(ps, p); break; case USBDEVFS_DISCONNECT_CLAIM: ret = proc_disconnect_claim(ps, p); break; case USBDEVFS_ALLOC_STREAMS: ret = proc_alloc_streams(ps, p); break; case USBDEVFS_FREE_STREAMS: ret = proc_free_streams(ps, p); break; case USBDEVFS_DROP_PRIVILEGES: ret = proc_drop_privileges(ps, p); break; } done: usb_unlock_device(dev); if (ret >= 0) inode->i_atime = CURRENT_TIME; return ret; }
C
linux
0
null
null
null
https://github.com/chromium/chromium/commit/1161a49d663dd395bd639549c2dfe7324f847938
1161a49d663dd395bd639549c2dfe7324f847938
Don't populate URL data in WebDropData when dragging files. This is considered a potential security issue as well, since it leaks filesystem paths. BUG=332579 Review URL: https://codereview.chromium.org/135633002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244538 0039d316-1c4b-4281-b951-d872f2087c98
void TabStrip::CalculateBoundsForDraggedTabs(const std::vector<Tab*>& tabs, std::vector<gfx::Rect>* bounds) { int x = 0; for (size_t i = 0; i < tabs.size(); ++i) { Tab* tab = tabs[i]; if (i > 0 && tab->data().mini != tabs[i - 1]->data().mini) x += kMiniToNonMiniGap; gfx::Rect new_bounds = tab->bounds(); new_bounds.set_origin(gfx::Point(x, 0)); bounds->push_back(new_bounds); x += tab->width() + tab_h_offset(); } }
void TabStrip::CalculateBoundsForDraggedTabs(const std::vector<Tab*>& tabs, std::vector<gfx::Rect>* bounds) { int x = 0; for (size_t i = 0; i < tabs.size(); ++i) { Tab* tab = tabs[i]; if (i > 0 && tab->data().mini != tabs[i - 1]->data().mini) x += kMiniToNonMiniGap; gfx::Rect new_bounds = tab->bounds(); new_bounds.set_origin(gfx::Point(x, 0)); bounds->push_back(new_bounds); x += tab->width() + tab_h_offset(); } }
C
Chrome
0
CVE-2015-1573
https://www.cvedetails.com/cve/CVE-2015-1573/
CWE-19
https://github.com/torvalds/linux/commit/a2f18db0c68fec96631c10cad9384c196e9008ac
a2f18db0c68fec96631c10cad9384c196e9008ac
netfilter: nf_tables: fix flush ruleset chain dependencies Jumping between chains doesn't mix well with flush ruleset. Rules from a different chain and set elements may still refer to us. [ 353.373791] ------------[ cut here ]------------ [ 353.373845] kernel BUG at net/netfilter/nf_tables_api.c:1159! [ 353.373896] invalid opcode: 0000 [#1] SMP [ 353.373942] Modules linked in: intel_powerclamp uas iwldvm iwlwifi [ 353.374017] CPU: 0 PID: 6445 Comm: 31c3.nft Not tainted 3.18.0 #98 [ 353.374069] Hardware name: LENOVO 5129CTO/5129CTO, BIOS 6QET47WW (1.17 ) 07/14/2010 [...] [ 353.375018] Call Trace: [ 353.375046] [<ffffffff81964c31>] ? nf_tables_commit+0x381/0x540 [ 353.375101] [<ffffffff81949118>] nfnetlink_rcv+0x3d8/0x4b0 [ 353.375150] [<ffffffff81943fc5>] netlink_unicast+0x105/0x1a0 [ 353.375200] [<ffffffff8194438e>] netlink_sendmsg+0x32e/0x790 [ 353.375253] [<ffffffff818f398e>] sock_sendmsg+0x8e/0xc0 [ 353.375300] [<ffffffff818f36b9>] ? move_addr_to_kernel.part.20+0x19/0x70 [ 353.375357] [<ffffffff818f44f9>] ? move_addr_to_kernel+0x19/0x30 [ 353.375410] [<ffffffff819016d2>] ? verify_iovec+0x42/0xd0 [ 353.375459] [<ffffffff818f3e10>] ___sys_sendmsg+0x3f0/0x400 [ 353.375510] [<ffffffff810615fa>] ? native_sched_clock+0x2a/0x90 [ 353.375563] [<ffffffff81176697>] ? acct_account_cputime+0x17/0x20 [ 353.375616] [<ffffffff8110dc78>] ? account_user_time+0x88/0xa0 [ 353.375667] [<ffffffff818f4bbd>] __sys_sendmsg+0x3d/0x80 [ 353.375719] [<ffffffff81b184f4>] ? int_check_syscall_exit_work+0x34/0x3d [ 353.375776] [<ffffffff818f4c0d>] SyS_sendmsg+0xd/0x20 [ 353.375823] [<ffffffff81b1826d>] system_call_fastpath+0x16/0x1b Release objects in this order: rules -> sets -> chains -> tables, to make sure no references to chains are held anymore. Reported-by: Asbjoern Sloth Toennesen <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
static int nf_tables_table_notify(const struct nft_ctx *ctx, int event) { struct sk_buff *skb; int err; if (!ctx->report && !nfnetlink_has_listeners(ctx->net, NFNLGRP_NFTABLES)) return 0; err = -ENOBUFS; skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); if (skb == NULL) goto err; err = nf_tables_fill_table_info(skb, ctx->net, ctx->portid, ctx->seq, event, 0, ctx->afi->family, ctx->table); if (err < 0) { kfree_skb(skb); goto err; } err = nfnetlink_send(skb, ctx->net, ctx->portid, NFNLGRP_NFTABLES, ctx->report, GFP_KERNEL); err: if (err < 0) { nfnetlink_set_err(ctx->net, ctx->portid, NFNLGRP_NFTABLES, err); } return err; }
static int nf_tables_table_notify(const struct nft_ctx *ctx, int event) { struct sk_buff *skb; int err; if (!ctx->report && !nfnetlink_has_listeners(ctx->net, NFNLGRP_NFTABLES)) return 0; err = -ENOBUFS; skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); if (skb == NULL) goto err; err = nf_tables_fill_table_info(skb, ctx->net, ctx->portid, ctx->seq, event, 0, ctx->afi->family, ctx->table); if (err < 0) { kfree_skb(skb); goto err; } err = nfnetlink_send(skb, ctx->net, ctx->portid, NFNLGRP_NFTABLES, ctx->report, GFP_KERNEL); err: if (err < 0) { nfnetlink_set_err(ctx->net, ctx->portid, NFNLGRP_NFTABLES, err); } return err; }
C
linux
0
CVE-2015-3845
https://www.cvedetails.com/cve/CVE-2015-3845/
CWE-264
https://android.googlesource.com/platform/frameworks/native/+/e68cbc3e9e66df4231e70efa3e9c41abc12aea20
e68cbc3e9e66df4231e70efa3e9c41abc12aea20
Disregard alleged binder entities beyond parcel bounds When appending one parcel's contents to another, ignore binder objects within the source Parcel that appear to lie beyond the formal bounds of that Parcel's data buffer. Bug 17312693 Change-Id: If592a260f3fcd9a56fc160e7feb2c8b44c73f514 (cherry picked from commit 27182be9f20f4f5b48316666429f09b9ecc1f22e)
status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob) { status_t status; if (!mAllowFds || len <= IN_PLACE_BLOB_LIMIT) { ALOGV("writeBlob: write in place"); status = writeInt32(0); if (status) return status; void* ptr = writeInplace(len); if (!ptr) return NO_MEMORY; outBlob->init(false /*mapped*/, ptr, len); return NO_ERROR; } ALOGV("writeBlob: write to ashmem"); int fd = ashmem_create_region("Parcel Blob", len); if (fd < 0) return NO_MEMORY; int result = ashmem_set_prot_region(fd, PROT_READ | PROT_WRITE); if (result < 0) { status = result; } else { void* ptr = ::mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (ptr == MAP_FAILED) { status = -errno; } else { result = ashmem_set_prot_region(fd, PROT_READ); if (result < 0) { status = result; } else { status = writeInt32(1); if (!status) { status = writeFileDescriptor(fd, true /*takeOwnership*/); if (!status) { outBlob->init(true /*mapped*/, ptr, len); return NO_ERROR; } } } } ::munmap(ptr, len); } ::close(fd); return status; }
status_t Parcel::writeBlob(size_t len, WritableBlob* outBlob) { status_t status; if (!mAllowFds || len <= IN_PLACE_BLOB_LIMIT) { ALOGV("writeBlob: write in place"); status = writeInt32(0); if (status) return status; void* ptr = writeInplace(len); if (!ptr) return NO_MEMORY; outBlob->init(false /*mapped*/, ptr, len); return NO_ERROR; } ALOGV("writeBlob: write to ashmem"); int fd = ashmem_create_region("Parcel Blob", len); if (fd < 0) return NO_MEMORY; int result = ashmem_set_prot_region(fd, PROT_READ | PROT_WRITE); if (result < 0) { status = result; } else { void* ptr = ::mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (ptr == MAP_FAILED) { status = -errno; } else { result = ashmem_set_prot_region(fd, PROT_READ); if (result < 0) { status = result; } else { status = writeInt32(1); if (!status) { status = writeFileDescriptor(fd, true /*takeOwnership*/); if (!status) { outBlob->init(true /*mapped*/, ptr, len); return NO_ERROR; } } } } ::munmap(ptr, len); } ::close(fd); return status; }
C
Android
0
CVE-2016-3751
https://www.cvedetails.com/cve/CVE-2016-3751/
null
https://android.googlesource.com/platform/external/libpng/+/9d4853418ab2f754c2b63e091c29c5529b8b86ca
9d4853418ab2f754c2b63e091c29c5529b8b86ca
DO NOT MERGE Update libpng to 1.6.20 BUG:23265085 Change-Id: I85199805636d771f3597b691b63bc0bf46084833 (cherry picked from commit bbe98b40cda082024b669fa508931042eed18f82)
gpc_Gprq(Pixel *out, const Pixel *in, const Background *back) { (void)back; if (in->r == in->g && in->g == in->b) out->r = out->g = out->b = ilineara_g22(in->g, in->a); else out->r = out->g = out->b = u16d(in->a * 257 * YfromRGB(g22_to_d[in->r], g22_to_d[in->g], g22_to_d[in->b])); out->a = 65535; }
gpc_Gprq(Pixel *out, const Pixel *in, const Background *back) { (void)back; if (in->r == in->g && in->g == in->b) out->r = out->g = out->b = ilineara_g22(in->g, in->a); else out->r = out->g = out->b = u16d(in->a * 257 * YfromRGB(g22_to_d[in->r], g22_to_d[in->g], g22_to_d[in->b])); out->a = 65535; }
C
Android
0
CVE-2018-13006
https://www.cvedetails.com/cve/CVE-2018-13006/
CWE-125
https://github.com/gpac/gpac/commit/bceb03fd2be95097a7b409ea59914f332fb6bc86
bceb03fd2be95097a7b409ea59914f332fb6bc86
fixed 2 possible heap overflows (inc. #1088)
GF_Box *stvi_New() { ISOM_DECL_BOX_ALLOC(GF_StereoVideoBox, GF_ISOM_BOX_TYPE_STVI); return (GF_Box *)tmp; }
GF_Box *stvi_New() { ISOM_DECL_BOX_ALLOC(GF_StereoVideoBox, GF_ISOM_BOX_TYPE_STVI); return (GF_Box *)tmp; }
C
gpac
0