mirror of
https://github.com/nimbold/Firelink.git
synced 2026-10-25 21:19:49 +00:00
1c5895156a
- Read SquashFS permissions after locating the embedded filesystem. - Reject malformed and unsafe AppImage offsets. - Cover offset parsing with regression tests.
8 lines
290 B
JavaScript
8 lines
290 B
JavaScript
export function parseAppImageOffset(output) {
|
|
const offset = typeof output === 'string' ? output.trim() : '';
|
|
if (!/^[1-9]\d*$/.test(offset) || !Number.isSafeInteger(Number(offset))) {
|
|
throw new Error('AppImage runtime returned an invalid SquashFS offset.');
|
|
}
|
|
return offset;
|
|
}
|