]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
libsframe: fix error code in sframe_decode
authorIndu Bhagat <indu.bhagat@oracle.com>
Sun, 6 Jul 2025 02:02:24 +0000 (19:02 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Sun, 6 Jul 2025 02:11:15 +0000 (19:11 -0700)
When sanity check of SFrame header fails, set error code to
SFRAME_ERR_BUF_INVAL instead of the current SFRAME_ERR_NOMEM.

libsframe/sframe.c

index d38a61dbd636384d6110046fcc1e7c493b03e060..2894009260d3f9339dd454a251e70ec7acf61653 100644 (file)
@@ -913,7 +913,7 @@ sframe_decode (const char *sf_buf, size_t sf_size, int *errp)
   sfheaderp = &dctx->sfd_header;
   if (!sframe_header_sanity_check_p (sfheaderp))
     {
-      sframe_ret_set_errno (errp, SFRAME_ERR_NOMEM);
+      sframe_ret_set_errno (errp, SFRAME_ERR_BUF_INVAL);
       goto decode_fail_free;
     }
   hdrsz = sframe_get_hdr_size (sfheaderp);