View | Details | Raw Unified | Return to bug 570183
Collapse All | Expand All

(-)poppler-0.12.0/goo/gmem.cc (+17 lines)
Lines 536-539 Link Here
536
void *gmallocn(int nObjs, int objSize) GMEM_EXCEP {
537
  return gmallocn(nObjs, objSize, false);
538
}
539
536
void *gmallocn_checkoverflow(SafeInt nObjs, SafeInt objSize) GMEM_EXCEP {
540
void *gmallocn_checkoverflow(SafeInt nObjs, SafeInt objSize) GMEM_EXCEP {
537
  return gmallocn(nObjs, objSize, true);
541
  return gmallocn(nObjs, objSize, true);
538
}
542
}
539
543
544
void *gmallocn_checkoverflow(int nObjs, int objSize) GMEM_EXCEP {
545
  return gmallocn(nObjs, objSize, true);
546
}
547
Lines 588-591 Link Here
596
void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP {
597
  return greallocn(p, nObjs, objSize, false);
598
}
599
600
588
void *greallocn_checkoverflow(void *p, SafeInt nObjs, SafeInt objSize) GMEM_EXCEP {
601
void *greallocn_checkoverflow(void *p, SafeInt nObjs, SafeInt objSize) GMEM_EXCEP {
589
  return greallocn(p, nObjs, objSize, true);
602
  return greallocn(p, nObjs, objSize, true);
590
}
603
}
591
604
605
void *greallocn_checkoverflow(void *p, int nObjs, int objSize) GMEM_EXCEP {
606
  return greallocn(p, nObjs, objSize, true);
607
}
608
(-)poppler-0.12.0/goo/gmem.h (-4 / +14 lines)
Lines 44-49 Link Here
44
44
45
#endif // USE_EXCEPTIONS
45
#endif // USE_EXCEPTIONS
46
46
47
#ifdef __cplusplus
47
class SafeInt
48
class SafeInt
48
{
49
{
49
  int c;
50
  int c;
Lines 135-140 Link Here
135
SafeInt operator*(const int& left, const SafeInt& right);
136
SafeInt operator*(const int& left, const SafeInt& right);
136
SafeInt operator/(const int& left, const SafeInt& right);
137
SafeInt operator/(const int& left, const SafeInt& right);
137
SafeInt operator%(const int& left, const SafeInt& right);
138
SafeInt operator%(const int& left, const SafeInt& right);
139
#endif
138
140
139
#ifdef __cplusplus
141
#ifdef __cplusplus
140
extern "C" {
142
extern "C" {
Lines 162-173 Link Here
162
 * The gmallocn_checkoverflow variant returns NULL instead of exiting
164
 * The gmallocn_checkoverflow variant returns NULL instead of exiting
163
 * the application if a overflow is detected
165
 * the application if a overflow is detected
164
 */
166
 */
165
extern void *gmallocn(SafeInt nObjs, SafeInt objSize) GMEM_EXCEP;
167
extern void *gmallocn(int nObjs, int objSize) GMEM_EXCEP;
166
extern void *gmallocn_checkoverflow(SafeInt nObjs, SafeInt objSize) GMEM_EXCEP;
168
extern void *gmallocn_checkoverflow(int nObjs, int objSize) GMEM_EXCEP;
167
extern void *gmallocn3(int a, int b, int c) GMEM_EXCEP;
169
extern void *gmallocn3(int a, int b, int c) GMEM_EXCEP;
168
extern void *gmallocn3_checkoverflow(int a, int b, int c) GMEM_EXCEP;
170
extern void *gmallocn3_checkoverflow(int a, int b, int c) GMEM_EXCEP;
169
extern void *greallocn(void *p, SafeInt nObjs, SafeInt objSize) GMEM_EXCEP;
171
extern void *greallocn(void *p, int nObjs, int objSize) GMEM_EXCEP;
170
extern void *greallocn_checkoverflow(void *p, SafeInt nObjs, SafeInt objSize) GMEM_EXCEP;
172
extern void *greallocn_checkoverflow(void *p, int nObjs, int objSize) GMEM_EXCEP;
171
173
172
/*
174
/*
173
 * Same as free, but checks for and ignores NULL pointers.
175
 * Same as free, but checks for and ignores NULL pointers.
Lines 199-200 Link Here
199
201
202
203
#ifdef __cplusplus
204
extern void *gmallocn(SafeInt nObjs, SafeInt objSize) GMEM_EXCEP;
205
extern void *gmallocn_checkoverflow(SafeInt nObjs, SafeInt objSize) GMEM_EXCEP;
206
extern void *greallocn(void *p, SafeInt nObjs, SafeInt objSize) GMEM_EXCEP;
207
extern void *greallocn_checkoverflow(void *p, SafeInt nObjs, SafeInt objSize) GMEM_EXCEP;
208
#endif
209
200
#endif
210
#endif

Return to bug 570183