Fix null pointer dereference vulnerability in pv_dup function
Checks
| Context |
Check |
Description |
| linaro-tcwg-bot/tcwg_binutils_build--master-arm |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 |
success
|
Build passed
|
| linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 |
success
|
Test passed
|
| linaro-tcwg-bot/tcwg_binutils_check--master-arm |
success
|
Test passed
|
Commit Message
From: pengxu2024 <pengxu@kylinos.cn>
---
opcodes/opc2c.c | 2 ++
1 file changed, 2 insertions(+)
@@ -462,6 +462,8 @@ pv_dup (char * p, char * ep)
{
int n = ep - p;
char *rv = (char *) malloc (n + 1);
+ if (rv == NULL)
+ return NULL;
memcpy (rv, p, n);
rv[n] = 0;