mirror of https://github.com/sysown/proxysql
parent
e84dc7ed0e
commit
c52a2c7841
@ -0,0 +1,18 @@
|
||||
@@ -1937,7 +1937,7 @@
|
||||
while (cnt > ncur);
|
||||
|
||||
/* if size is large, round to MALLOC_ROUND - 4 * longs to accommodate malloc overhead */
|
||||
- if (elem * ncur > MALLOC_ROUND - sizeof (void *) * 4)
|
||||
+ if ((long) elem * ncur > MALLOC_ROUND - sizeof (void *) * 4)
|
||||
{
|
||||
ncur *= elem;
|
||||
ncur = (ncur + elem + (MALLOC_ROUND - 1) + sizeof (void *) * 4) & ~(MALLOC_ROUND - 1);
|
||||
@@ -1953,7 +1953,7 @@
|
||||
array_realloc (int elem, void *base, int *cur, int cnt)
|
||||
{
|
||||
*cur = array_nextsize (elem, *cur, cnt);
|
||||
- return ev_realloc (base, elem * *cur);
|
||||
+ return ev_realloc (base, (long) elem * *cur);
|
||||
}
|
||||
|
||||
#define array_init_zero(base,count) \
|
||||
@ -0,0 +1,20 @@
|
||||
@@ -1582,11 +1582,18 @@
|
||||
MHD_HTTP_HEADER_CONNECTION))) &&
|
||||
(MHD_str_equal_caseless_ (pos->value,
|
||||
"Keep-Alive")) ) ) )
|
||||
- off += MHD_snprintf_ (&data[off],
|
||||
+ {
|
||||
+ int n = MHD_snprintf_ (&data[off],
|
||||
size - off,
|
||||
"%s: %s\r\n",
|
||||
pos->header,
|
||||
pos->value);
|
||||
+ if (n < 0 || n >= size - off)
|
||||
+ {
|
||||
+ break;
|
||||
+ }
|
||||
+ off += n;
|
||||
+ }
|
||||
}
|
||||
if (MHD_CONNECTION_FOOTERS_RECEIVED == connection->state)
|
||||
{
|
||||
@ -0,0 +1,9 @@
|
||||
@@ -248,7 +248,7 @@
|
||||
}
|
||||
o++;
|
||||
}
|
||||
- if (offset && !OPENSSL_gmtime_adj(&tmp, 0, offset * offsign))
|
||||
+ if (offset && !OPENSSL_gmtime_adj(&tmp, 0, (long) offset * offsign))
|
||||
goto err;
|
||||
} else {
|
||||
/* not Z, or not +/- in non-strict mode */
|
||||
@ -0,0 +1,9 @@
|
||||
@@ -588,7 +588,7 @@
|
||||
assert(position >= 0);
|
||||
if (odd & (1 << (table_bits + 1)))
|
||||
delta -= (1 << (table_bits + 1));
|
||||
- current -= delta * (1 << pos);
|
||||
+ current -= (long) delta * (1 << pos);
|
||||
control[position].power = pos + 16 * (w - 1);
|
||||
control[position].addend = delta;
|
||||
position--;
|
||||
@ -0,0 +1,53 @@
|
||||
@@ -46,7 +46,7 @@
|
||||
array->max_element=init_alloc;
|
||||
array->alloc_increment=alloc_increment;
|
||||
array->size_of_element=element_size;
|
||||
- if (!(array->buffer=(char*) malloc(element_size*init_alloc)))
|
||||
+ if (!(array->buffer=(char*) malloc((long) element_size*init_alloc)))
|
||||
{
|
||||
array->max_element=0;
|
||||
return(TRUE);
|
||||
@@ -80,7 +80,7 @@
|
||||
if (array->elements == array->max_element)
|
||||
{
|
||||
char *new_ptr;
|
||||
- if (!(new_ptr=(char*) realloc(array->buffer,(array->max_element+
|
||||
+ if (!(new_ptr=(char*) realloc(array->buffer,(long) (array->max_element+
|
||||
array->alloc_increment)*
|
||||
array->size_of_element)))
|
||||
return 0;
|
||||
@@ -111,14 +111,14 @@
|
||||
char *new_ptr;
|
||||
size=(idx+array->alloc_increment)/array->alloc_increment;
|
||||
size*= array->alloc_increment;
|
||||
- if (!(new_ptr=(char*) realloc(array->buffer,size*
|
||||
+ if (!(new_ptr=(char*) realloc(array->buffer,(long) size*
|
||||
array->size_of_element)))
|
||||
return TRUE;
|
||||
array->buffer=new_ptr;
|
||||
array->max_element=size;
|
||||
}
|
||||
memset((array->buffer+array->elements*array->size_of_element), 0,
|
||||
- (idx - array->elements)*array->size_of_element);
|
||||
+ (long) (idx - array->elements)*array->size_of_element);
|
||||
array->elements=idx+1;
|
||||
}
|
||||
memcpy(array->buffer+(idx * array->size_of_element),element,
|
||||
@@ -155,7 +155,7 @@
|
||||
char *ptr=array->buffer+array->size_of_element*idx;
|
||||
array->elements--;
|
||||
memmove(ptr,ptr+array->size_of_element,
|
||||
- (array->elements-idx)*array->size_of_element);
|
||||
+ (long) (array->elements-idx)*array->size_of_element);
|
||||
}
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
if (array->buffer && array->max_element != elements)
|
||||
{
|
||||
array->buffer=(char*) realloc(array->buffer,
|
||||
- elements*array->size_of_element);
|
||||
+ (long) elements*array->size_of_element);
|
||||
array->max_element=elements;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
@@ -3999,13 +3999,13 @@
|
||||
(val->x.time_value.neg ? -1 : 1);
|
||||
break;
|
||||
case DYN_COL_DATE:
|
||||
- *ll= (val->x.time_value.year * 10000 +
|
||||
+ *ll= ((long) val->x.time_value.year * 10000 +
|
||||
val->x.time_value.month * 100 +
|
||||
val->x.time_value.day) *
|
||||
(val->x.time_value.neg ? -1 : 1);
|
||||
break;
|
||||
case DYN_COL_TIME:
|
||||
- *ll= (val->x.time_value.hour * 10000 +
|
||||
+ *ll= ((long) val->x.time_value.hour * 10000 +
|
||||
val->x.time_value.minute * 100 +
|
||||
val->x.time_value.second) *
|
||||
(val->x.time_value.neg ? -1 : 1);
|
||||
@ -0,0 +1,9 @@
|
||||
@@ -303,7 +303,7 @@
|
||||
unsigned size;
|
||||
{
|
||||
if (opaque) items += size - size; /* make compiler happy */
|
||||
- return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
|
||||
+ return sizeof(uInt) > 2 ? (voidpf)malloc((long) items * size) :
|
||||
(voidpf)calloc(items, size);
|
||||
}
|
||||
|
||||
@ -0,0 +1,9 @@
|
||||
@@ -4094,7 +4094,7 @@
|
||||
#endif
|
||||
new_info(re, NULL, PCRE_INFO_SIZE, &size);
|
||||
fprintf(outfile, "Memory allocation (code space): %d\n",
|
||||
- (int)(size - real_pcre_size - name_count * name_entry_size));
|
||||
+ (int)(size - real_pcre_size - (long) name_count * name_entry_size));
|
||||
}
|
||||
|
||||
/* If -s or /S was present, study the regex to generate additional info to
|
||||
@ -0,0 +1,12 @@
|
||||
@@ -611,9 +611,9 @@
|
||||
LOG(ERROR) << "nodes:\n" << dump;
|
||||
}
|
||||
|
||||
- dfa_mem_ -= nalloc*statesize;
|
||||
+ dfa_mem_ -= static_cast<long>(nalloc)*statesize;
|
||||
onepass_nodes_ = PODArray<uint8_t>(nalloc*statesize);
|
||||
- memmove(onepass_nodes_.data(), nodes.data(), nalloc*statesize);
|
||||
+ memmove(onepass_nodes_.data(), nodes.data(), static_cast<long>(nalloc)*statesize);
|
||||
return true;
|
||||
|
||||
fail:
|
||||
@ -0,0 +1,18 @@
|
||||
@@ -103301,7 +103301,7 @@
|
||||
int n = *pnEntry;
|
||||
if( (n & (n-1))==0 ){
|
||||
int sz = (n==0) ? 1 : 2*n;
|
||||
- void *pNew = sqlite3DbRealloc(db, pArray, sz*szEntry);
|
||||
+ void *pNew = sqlite3DbRealloc(db, pArray, (long) sz*szEntry);
|
||||
if( pNew==0 ){
|
||||
*pIdx = -1;
|
||||
return pArray;
|
||||
@@ -141183,7 +141183,7 @@
|
||||
pStart = 0;
|
||||
}else if( pBuf==0 ){
|
||||
sqlite3BeginBenignMalloc();
|
||||
- pStart = sqlite3Malloc( sz*cnt ); /* IMP: R-61949-35727 */
|
||||
+ pStart = sqlite3Malloc( (long) sz*cnt ); /* IMP: R-61949-35727 */
|
||||
sqlite3EndBenignMalloc();
|
||||
if( pStart ) cnt = sqlite3MallocSize(pStart)/sz;
|
||||
}else{
|
||||
Loading…
Reference in new issue