Skip to content

Commit 461add2

Browse files
Fortify ggml_rope_impl
Only memcpy data from sections argument if it's non-NULL. Signed-off-by: Aaron Teo <[email protected]>
1 parent 4aa2c9e commit 461add2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ggml/src/ggml.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3927,7 +3927,7 @@ static struct ggml_tensor * ggml_rope_impl(
39273927
memcpy(params + 8, &attn_factor, sizeof(float));
39283928
memcpy(params + 9, &beta_fast, sizeof(float));
39293929
memcpy(params + 10, &beta_slow, sizeof(float));
3930-
if (mrope_used) {
3930+
if (mrope_used && sections) {
39313931
memcpy(params + 11, sections, sizeof(int32_t) * GGML_MROPE_SECTIONS);
39323932
} else {
39333933
memset(params + 11, 0, sizeof(int32_t) * GGML_MROPE_SECTIONS);

0 commit comments

Comments
 (0)