Opened 13 years ago
Closed 13 years ago
#134 closed defect (fixed)
sizeof(NGX_INT32_LEN) triggers out of memory
Reported by: | Vincent Lee | Owned by: | somebody |
---|---|---|---|
Priority: | major | Milestone: | 1.2.0 |
Component: | other | Version: | 1.1.x |
Keywords: | out of memory | Cc: | |
uname -a: | windows | ||
nginx -V: | nginx version: nginx/1.1.16 |
Description
FILE:nginx/trunk/src/os/win32/ngx_shmem.c, LINES:18
Index: ngx_shmem.c
===================================================================
--- ngx_shmem.c (revision 4567)
+++ ngx_shmem.c (working copy)
@@ -15,7 +15,7 @@
u_char *name;
uint64_t size;
- name = ngx_alloc(shm->name.len + 2 + sizeof(NGX_INT32_LEN), shm->log);
+ name = ngx_alloc(shm->name.len + 2 + NGX_INT32_LEN, shm->log);
if (name == NULL) {
return NGX_ERROR;
}
the NGX_INT32_LEN finger out the length of INT32 string. don't need to sizeof again.
if call sizeof again, ngx_alloc will get a smaller buffer, and then will be out of memory.
Attachments (1)
Change History (8)
by , 13 years ago
Attachment: | ngx_shmem.c.patch added |
---|
comment:1 by , 13 years ago
Status: | new → accepted |
---|
follow-up: 4 comment:3 by , 13 years ago
Fix committed, thanks. Could you please provide proper english transcription of you name (for CHANGES)?
comment:4 by , 13 years ago
Replying to Maxim Dounin:
Fix committed, thanks. Could you please provide proper english transcription of you name (for CHANGES)?
i cannot find where to set my english name, it seems that this name is fetched from google+. my english name is vincent.lee, you can call me: vincent. thank you.
follow-up: 6 comment:5 by , 13 years ago
We usually provide properly capitalized full names in CHANGES. Is "Vincent Lee" looks ok?
comment:6 by , 13 years ago
Replying to Maxim Dounin:
We usually provide properly capitalized full names in CHANGES. Is "Vincent Lee" looks ok?
ok,thanks.
svn path