author | David Hollister <david.hollister@oracle.com> |
Wed, 12 Oct 2016 14:01:13 -0600 | |
changeset 7094 | 61352b4e5af5 |
parent 6510 | d00d3d1fc778 |
permissions | -rw-r--r-- |
6510
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
1 |
# Source: Internal |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
2 |
# Info: Written internally to initialize buffer size and check buffer size |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
3 |
# before freeing allocation. |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
4 |
# Status: This patch is offered at https://bugs.launchpad.net/ubuntu/+source/sbsigntool/+bug/1588548 |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
5 |
|
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
6 |
--- ORIGINAL/src/image.c 2016-06-14 16:11:33.636416993 -0700 |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
7 |
+++ sbsigntool-0.6/src/image.c 2016-06-14 17:21:43.051988811 -0700 |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
8 |
@@ -406,6 +406,7 @@ |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
9 |
goto err; |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
10 |
|
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
11 |
reparse: |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
12 |
+ image->sigsize = 0; |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
13 |
rc = image_pecoff_parse(image); |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
14 |
if (rc) |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
15 |
goto err; |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
16 |
@@ -478,7 +479,8 @@ |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
17 |
/* we only support one signature at present */ |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
18 |
if (image->sigbuf) { |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
19 |
fprintf(stderr, "warning: overwriting existing signature\n"); |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
20 |
- talloc_free(image->sigbuf); |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
21 |
+ if ((int)image->sigsize > 0) |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
22 |
+ talloc_free(image->sigbuf); |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
23 |
} |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
24 |
image->sigbuf = sig; |
d00d3d1fc778
PSARC/2016/276 sbsigntool integration
jiawliu <gerry.liu@oracle.com>
parents:
diff
changeset
|
25 |
image->sigsize = size; |