Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 158510 Details for
Bug 203673
Xvnc: SProcShmCreatePixmap() fails to byte-swap 'pid'
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Proposed patch
dif (text/plain), 3.76 KB, created by
Adam Tkac
on 2007-07-04 09:46:16 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Adam Tkac
Created:
2007-07-04 09:46:16 UTC
Size:
3.76 KB
patch
obsolete
>diff -up vnc-4.0-unixsrc/xc/lib/font/bitmap/pcfread.c.pcf-flow vnc-4.0-unixsrc/xc/lib/font/bitmap/pcfread.c >--- vnc-4.0-unixsrc/xc/lib/font/bitmap/pcfread.c.pcf-flow 2004-04-23 20:44:20.000000000 +0200 >+++ vnc-4.0-unixsrc/xc/lib/font/bitmap/pcfread.c 2007-07-04 11:43:30.000000000 +0200 >@@ -41,6 +41,7 @@ from The Open Group. > #endif > > #include <stdarg.h> >+#include <stdint.h> > > void > pcfError(const char* message, ...) >@@ -129,6 +130,11 @@ pcfReadTOC(FontFilePtr file, int *countp > return (PCFTablePtr) NULL; > count = pcfGetLSB32(file); > if (IS_EOF(file)) return (PCFTablePtr) NULL; >+ if (count < 0 || count > INT32_MAX / sizeof(PCFTableRec)) >+ { >+ pcfError("pcfReadTOC(): invalid file format\n"); >+ return NULL; >+ } > tables = (PCFTablePtr) xalloc(count * sizeof(PCFTableRec)); > if (!tables) { > pcfError("pcfReadTOC(): Couldn't allocate tables (%d*%d)\n", count, sizeof(PCFTableRec)); >@@ -248,6 +254,11 @@ pcfGetProperties(FontInfoPtr pFontInfo, > if (!PCF_FORMAT_MATCH(format, PCF_DEFAULT_FORMAT)) > goto Bail; > nprops = pcfGetINT32(file, format); >+ if (nprops <= 0 || nprops > INT_MAX / sizeof(FontPropRec)) >+ { >+ pcfError("pcfGetProperties(): invalid nprops value (%d)\n", nprops); >+ goto Bail; >+ } > if (IS_EOF(file)) goto Bail; > props = (FontPropPtr) xalloc(nprops * sizeof(FontPropRec)); > if (!props) { >@@ -263,6 +274,13 @@ pcfGetProperties(FontInfoPtr pFontInfo, > props[i].name = pcfGetINT32(file, format); > isStringProp[i] = pcfGetINT8(file, format); > props[i].value = pcfGetINT32(file, format); >+ if (props[i].name < 0 >+ || (isStringProp[i] != 0 && isStringProp[i] != 1) >+ || (isStringProp[i] && props[i].value < 0)) { >+ pcfError("pcfGetProperties(): invalid file format %d %d %d\n", >+ props[i].name, isStringProp[i], props[i].value); >+ goto Bail; >+ } > if (IS_EOF(file)) goto Bail; > } > /* pad the property array */ >@@ -278,6 +296,7 @@ pcfGetProperties(FontInfoPtr pFontInfo, > } > if (IS_EOF(file)) goto Bail; > string_size = pcfGetINT32(file, format); >+ if (string_size < 0) goto Bail; > if (IS_EOF(file)) goto Bail; > strings = (char *) xalloc(string_size); > if (!strings) { >@@ -418,6 +437,10 @@ pcfReadFont(FontPtr pFont, FontFilePtr f > else > nmetrics = pcfGetINT16(file, format); > if (IS_EOF(file)) goto Bail; >+ if (nmetrics < 0 || nmetrics > INT32_MAX / sizeof(CharInfoRec)) { >+ pcfError("pcfReadFont(): invalid file format\n"); >+ goto Bail; >+ } > metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec)); > if (!metrics) { > pcfError("pcfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec)); >@@ -444,6 +467,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr f > if (nbitmaps != nmetrics || IS_EOF(file)) > goto Bail; > >+ /* nmetrics is alreadt ok, so nbitmap also is */ > offsets = (CARD32 *) xalloc(nbitmaps * sizeof(CARD32)); > if (!offsets) { > pcfError("pcfReadFont(): Couldn't allocate offsets (%d*%d)\n", nbitmaps, sizeof(CARD32)); >@@ -457,6 +481,7 @@ pcfReadFont(FontPtr pFont, FontFilePtr f > for (i = 0; i < GLYPHPADOPTIONS; i++) { > bitmapSizes[i] = pcfGetINT32(file, format); > if (IS_EOF(file)) goto Bail; >+ if (bitmapSizes[i] < 0) goto Bail; > } > > sizebitmaps = bitmapSizes[PCF_GLYPH_PAD_INDEX(format)]; >@@ -805,6 +830,10 @@ pmfReadFont(FontPtr pFont, FontFilePtr f > else > nmetrics = pcfGetINT16(file, format); > if (IS_EOF(file)) goto Bail; >+ if (nmetrics < 0 || nmetrics > INT32_MAX / sizeof(CharInfoRec)) { >+ pcfError("pmfReadFont(): invalid file format\n"); >+ goto Bail; >+ } > metrics = (CharInfoPtr) xalloc(nmetrics * sizeof(CharInfoRec)); > if (!metrics) { > pcfError("pmfReadFont(): Couldn't allocate metrics (%d*%d)\n", nmetrics, sizeof(CharInfoRec));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 203673
:
158510
|
158512