diff options
-rw-r--r-- | flash_otp_write.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/flash_otp_write.c b/flash_otp_write.c index 3515eee..eaca5e1 100644 --- a/flash_otp_write.c +++ b/flash_otp_write.c @@ -83,6 +83,12 @@ int main(int argc,char *argv[]) else len = 256; + if (len > sizeof(buf)) { + printf("huh, writesize (%d) bigger than buffer (%zu)\n", + len, sizeof(buf)); + return ENOMEM; + } + wrote = 0; while ((size = xread(0, buf, len))) { if (size < 0) { |