summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-private/private-history.cc2
-rwxr-xr-xtest/integration/test-history4
2 files changed, 6 insertions, 0 deletions
diff --git a/apt-private/private-history.cc b/apt-private/private-history.cc
index cf4540772..31b3b1333 100644
--- a/apt-private/private-history.cc
+++ b/apt-private/private-history.cc
@@ -352,6 +352,8 @@ class TransactionController
static bool ParseId(const char *str, size_t &id, size_t max)
{
+ if (str == nullptr)
+ return _error->Error(_("Incorrect usage, no ID was given."));
try
{
id = std::stoi(str);
diff --git a/test/integration/test-history b/test/integration/test-history
index e10dab08e..34108e357 100755
--- a/test/integration/test-history
+++ b/test/integration/test-history
@@ -128,3 +128,7 @@ End time: dummy
Requested by:
Command line: install nothing
Packages changed:" normalizedinfo
+
+testfailureequal "E: Incorrect usage, no ID was given." apt history-redo
+testfailureequal "E: Incorrect usage, no ID was given." apt history-undo
+testfailureequal "E: Incorrect usage, no ID was given." apt history-rollback