apsun / loliOS

Lightweight & operational Linux-inspired OS.
33 stars 1 forks source link

Handle getargs() buffer too small #13

Closed apsun closed 7 years ago

apsun commented 7 years ago

If the length of the input buffer is too small, we should either return -1 or at least make sure the string is NUL-terminated, since the test programs assume that if the call succeeded, the buffer is valid.

Hertin commented 7 years ago

if (nbytes > 0) { buf[nbytes - 1] = '\0'; }

apsun commented 7 years ago

Fixed in r12578