cpp: Fix use after free in gencardkeyinteractor
* lang/cpp/src/gpggencardkeyinteractor.cpp (GpgGenCardKeyInteractor::Private::keysize): Change to string. -- The value is only required as string so we can save it this way to avoid the need to convert it for the action command. GnuPG-Bug-Id: T4094
This commit is contained in:
parent
d09d19fa9f
commit
3b78244360
@ -36,12 +36,11 @@ using namespace GpgME;
|
||||
class GpgGenCardKeyInteractor::Private
|
||||
{
|
||||
public:
|
||||
Private() : keysize(2048), backup(false)
|
||||
Private() : keysize("2048"), backup(false)
|
||||
{
|
||||
|
||||
}
|
||||
std::string name, email, backupFileName, expiry, serial;
|
||||
int keysize;
|
||||
std::string name, email, backupFileName, expiry, serial, keysize;
|
||||
bool backup;
|
||||
};
|
||||
|
||||
@ -70,7 +69,7 @@ void GpgGenCardKeyInteractor::setDoBackup(bool value)
|
||||
|
||||
void GpgGenCardKeyInteractor::setKeySize(int value)
|
||||
{
|
||||
d->keysize = value;
|
||||
d->keysize = std::to_string(value);
|
||||
}
|
||||
|
||||
void GpgGenCardKeyInteractor::setExpiry(const std::string &timeStr)
|
||||
@ -132,7 +131,7 @@ const char *GpgGenCardKeyInteractor::action(Error &err) const
|
||||
case SIZE:
|
||||
case SIZE2:
|
||||
case SIZE3:
|
||||
return std::to_string(d->keysize).c_str();
|
||||
return d->keysize.c_str();
|
||||
case COMMENT:
|
||||
return "";
|
||||
case SAVE:
|
||||
|
Loading…
Reference in New Issue
Block a user