mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
- Protect AllocateValue against a null sp.
modified: storage/connect/value.cpp
This commit is contained in:
parent
7ebd3f6fed
commit
5b460c6403
1 changed files with 2 additions and 2 deletions
|
@ -446,7 +446,7 @@ PVAL AllocateValue(PGLOBAL g, PVAL valp, int newtype, int uns)
|
|||
case TYPE_STRING:
|
||||
p = (PSZ)PlugSubAlloc(g, NULL, 1 + valp->GetValLen());
|
||||
|
||||
if ((sp = valp->GetCharString(p)) != p)
|
||||
if ((sp = valp->GetCharString(p)) != p && sp)
|
||||
strcpy(p, sp);
|
||||
|
||||
vp = new(g) TYPVAL<PSZ>(g, p, valp->GetValLen(), valp->GetValPrec());
|
||||
|
@ -1219,7 +1219,7 @@ TYPVAL<PSZ>::TYPVAL(PSZ s) : VALUE(TYPE_STRING)
|
|||
TYPVAL<PSZ>::TYPVAL(PGLOBAL g, PSZ s, int n, int c)
|
||||
: VALUE(TYPE_STRING)
|
||||
{
|
||||
Len = (g) ? n : strlen(s);
|
||||
Len = (g) ? n : (s) ? strlen(s) : 0;
|
||||
|
||||
if (!s) {
|
||||
if (g) {
|
||||
|
|
Loading…
Reference in a new issue