summaryrefslogtreecommitdiff
path: root/runkernel.inc
diff options
context:
space:
mode:
Diffstat (limited to 'runkernel.inc')
-rw-r--r--runkernel.inc9
1 files changed, 6 insertions, 3 deletions
diff --git a/runkernel.inc b/runkernel.inc
index bc31f9e1..f73998e5 100644
--- a/runkernel.inc
+++ b/runkernel.inc
@@ -345,9 +345,12 @@ need_high_cmdline:
mov [fs:kern_cmd_offset],di ; Store pointer
mov cx,[CmdLineLen]
- add cx,byte 3
- shr cx,2 ; Convert to dwords
- fs rep movsd
+ cmp cx,255
+ jna .len_ok
+ mov cx,255 ; Protocol < 0x202 has 255 as hard limit
+.len_ok:
+ fs rep movsb
+ fs stosb ; Final null, note AL == 0 here
push fs
pop es