mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
sqlite: reject non-positive backup rates
Passing a rate of 0 to backup() causes sqlite3_backup_step() to copy no pages. The backup job then continually reschedules itself and the returned promise never settles. Require backup rates to be positive integers to prevent zero-work backup jobs. Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com> Assisted-by: codex:gpt-5.6-sol PR-URL: https://github.com/nodejs/node/pull/64893 Fixes: https://github.com/nodejs/node/issues/64892 Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
f066147562
commit
f538f11faf
3 files changed
+16
-1
No files matched your search
@@ -2200,6 +2200,12 @@ void Backup(const FunctionCallbackInfo<Value>& args) {
|
||||
return;
|
||||
}
|
||||
rate = rate_v.As<Int32>()->Value();
|
||||
if (rate <= 0) {
|
||||
THROW_ERR_OUT_OF_RANGE(
|
||||
env->isolate(),
|
||||
"The \"options.rate\" argument must be a positive integer.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Local<Value> source_v;
|
||||
|
||||
Reference in new issue
Block a user