goto Cleanup;
}
//read kernel delta header for delta names and size
- buf = SS_Malloc(SS_KERNEL_DELTA_HEADER);
+ buf = SS_Malloc(SS_KERNEL_DELTA_HEADER + 1);
if (!buf) {//wgid: 13099
LOGE("Failed to allocate memory\n");
result = E_SS_MALLOC_ERROR;
ssize_t bytes_read = fread(buf, 1, SS_KERNEL_DELTA_HEADER, fp);
if (bytes_read != SS_KERNEL_DELTA_HEADER)
LOGL(LOG_SSENGINE, "short read of \"%s\" (%ld bytes of %ld)\n", SS_PATCHFILE_SOURCE, (long)bytes_read, (long)SS_KERNEL_DELTA_HEADER);
+ buf[bytes_read] = '\0';
+
magic = strtok_r(buf, ":", &saveptr);
LOGL(LOG_SSENGINE, "magic: %s\n", magic);
tok_buf = strtok_r(NULL, ":", &saveptr);
long int udelta_size = 0;
int ulResult = S_SS_SUCCESS;
+ file.data = NULL;
if (stat(filename, &file.st) != 0) {
strerror_r(errno, buf, sizeof(buf));
LOGE("failed to stat \"%s\": %s\n", filename, buf);
}
return E_SS_FAILURE;
}
+ item_data[read_data] = '\0';
+
pline = strtok_r(item_data, "\n", &psaveptr);
if (pline == NULL) {
LOGL(LOG_SSENGINE, "No Attributes to SET as no lines in file\n");
void
sha1_init(sha1_ctx_t *ctx) {
+ int i;
/* initialize state vector */
ctx->H[0] = 0x67452301;
ctx->H[3] = 0x10325476;
ctx->H[4] = 0xc3d2e1f0;
+ for(i = 0; i < 16; i++) {
+ ctx->M[i] = 0;
+ }
+
/* indicate that message buffer is empty */
ctx->octets_in_buffer = 0;