Fix paste ownership, input bounds, and IPC validation
Supersedes #5745, #5746, and #5747.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { validateComputerClipboardPasteTextWithBoundedYield } from './computer-clipboard-paste-validation'
|
||||
|
||||
export function validateComputerSidecarPasteText(
|
||||
method: string,
|
||||
params: unknown
|
||||
): Promise<void> | void {
|
||||
if (method !== 'pasteText' || !params || typeof params !== 'object') {
|
||||
return
|
||||
}
|
||||
const text = (params as Record<string, unknown>).text
|
||||
if (typeof text !== 'string') {
|
||||
return
|
||||
}
|
||||
return validateComputerClipboardPasteTextWithBoundedYield(text)
|
||||
}
|
||||
Reference in New Issue
Block a user